relationshipWhere()

relationshipWhere($linkName, $condition_start, $stringOperator = null, $conditon_end = null, $condition = "AND", $override = false)

It puts a WHERE clause when you want to get a relationship with specific caracteristics.
If override is true then cleanup old stuff.

@param String $linkName
@param String $condition_start
@param String $stringOperator
@param String $conditon_end
@param String $condition
@param Boolean $override
@return PhpBURN_Core

Params


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

$condition_start
What will match.
Usualy a field but you can match ANYTHING

$stringOperator
The operator of the match

$conditon_end
What will match with $condition_start

$condition (optional)
By default $condition is equal “AND” that means you can cascade various wheres without worry about putting AND but if you and to change it just fill this OPTIONAL field.

$override (optional)
Clean others $model->where(…) seted before this and starts again.

Explanation


You can use this method leting it be 100% compatible with all databases, that means if one day you boss wake up and say: Let’s migrate to Oracle because IBM uses it you will not be arrested because you try to kill him you will smile and say: Right the way 🙂

Example:


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

$user->relationshipWhere('albums','name','=','My Travel');

$user->getRelationship('albums');

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