getRelationship($name, $fluid = false, array $options = array())

Works like $model->find() but instead it search ofr a mapped relationship.
Generate a SELECT into the relationship.

@param String $name
@param Boolean $fluid
@param Array $options
@return Mixed ( Integer/PhpBURN_Core )


The name of mapped relationship defined by $model->getMap()->addRelationship().

Boolean param to work with FLUID INTERFACE that means intead return the affected rows it will return the same model

Array of options to getRelationship ( we do not recommend this, instead use relationship*() methods )


This method works just like find() but has differents params here we have a mandatory param called $name, without this you can’t tell the system wich mapped relationship you’re looking for.

It returns two different things. If you do not specify $fluid = true it will return the number of affected rows but if you do it will work with FLUID INTERFACE and returns Model/PhpBURN_Core instead.

To learn how to create relationships see addRelationship() in Documentation at

Default usage

$user = new Users();


while($user->albums->fetch()) {

Once called the relationship it will create an attribute in your model with the SAME NAME of the relationship working like a PhpBURN Model, that means it is recursively and you can have how many relationships you want.

It will work no more like a ENTITY ORIENTED database but like a OBJECT ORIENTED database or ( document oriented )

For example:

$user = new Users();


while($user->albums->fetch()) {

         while( $user->albums->pictures->fetch() ) {


                  while($user->albums->pictures->comments->fetch()) {



You can also use FLUID INTERFACE doing:

$user = new Users();