relationshipSelect($linkName, $field, $alias = null, $only = true, $override = false)

Works like select() but for getRelationship() calls
@param String $linkName
@param String $field
@param String $alias
@param Boolean $only
@param Boolean $override
@return PhpBURN_Core


Is the name of the relationship that will receive the commands

The SELECT condition, for example: “COUNT(id_users)” or “name”

The alias to be outputed to the model example: “total” or “full_name”

$only (deprecated)

$override (optional)
Optional field that clean all select() used before and starts again.


Sometimes you need to use a function or even give another name for that field you mapped, well, now you can EASY EASY…

Let’s see how to use a function to COUNT the registers for example:

$user = new Users();


$totalLines = $user->getRelationship('albums);

print $user->albums->fetch()->total;

Note that $totalLines is different from total, in $totalLines in this case will return 1 while $user->albums->total will return the amount of items in the table.