relationshipLike()

relationshipLike($linkName, $field, $content, $condition = 'AND')

Works like like() but for getRelationship() call
@param String $linkName
@param String $field
@param Mixed $content
@param String $condition
@return PhpBURN_Core

Params


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

$field
Model field that will receive LIKE statement

$content
The LIKE content statement. Ex. “A%” or “%Smith” or “%Jo%”

$condition (optional)
By default it have “AND” condition but you can change it to another one if you fill this optional field

Explanation


$user = new Users();
$user->get(1);

$user->relationshipLike('albums','name','A%');

$user->getRelationship('albums');

It will return all our Related Albums that name begins with A, for example: Andy, Anderson, Acid, etc…

$user = new Users();
$user->get(1);

$user->relationshipLike('albums','name','%JO%');

$user->getRelationship('albums');

It will bring us all Related Albums with JO in any part of their name such as Mojo, John, Mijoyo, etc….