relationshipLimit()

relationshipLimit($linkName, $offset = null, $limit = null)

Works like limit() but for getRelationship() call
@param String $linkName
@param Integer $offset
@param Integer $limit
@return PhpBURN_Core

Params


$linkName
Is the name of the relationship that will receive the commands

$offset
This can work in two different ways, if $limit isn’t set so this param will became the limit and will bring the X entries that you ask for if you set $limit param than it will be the offset of your range limit.

$limit
This will define the limit with the offset ( mostly used to paginate your results )

Explanation


This is a VERY VERY VERY helpful function, as you may know each database have it’s own way to do this thing but with PhpBURN you don’t have to worry about that, you just have to use and focus on your own business, pretty nice uh? 😉

Well, let’s see it running:

Paginate our relationship limit to 10 results

$user = new Users();

$user->get(1);

$user->relationshipLimit('albums',0,10);

$user->getRelationship('albums');

For more and detailed information see limit() at www.phpburn.com/documentation/orm/limit