Skip to content

Commit

Permalink
Qualify method for creating fully qualified column names
Browse files Browse the repository at this point in the history
  • Loading branch information
ronanchilvers committed Jun 11, 2019
1 parent 42767d5 commit 44a7075
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,23 @@ static public function unprefix($string)
return $string;
}

/**
* Transform a string into a fully qualified column with table and prefix
*
* @param string $string
* @return string
* @author Ronan Chilvers <[email protected]>
*/
public static function qualify($string)
{
if ('*' != $string) {
$string = static::prefix($string);
}
$table = static::table();

return "{$table}.{$string}";
}

/**
* @var array
*/
Expand Down

0 comments on commit 44a7075

Please sign in to comment.