src/Titon/Model/Model.php
public function addRelation(Relation $relation) {
        $relation->setPrimaryModel($this);

        $this->_relations[$relation->getAlias()] = $relation;
        $this->_aliases[$relation->getRelatedClass()] = $relation->getAlias();
        $this->reserved[] = $relation->getAlias();

        $this->on('relation', $relation);

        return $this;
    }
public function addRelation(Relation $relation) {
        $relation->setPrimaryModel($this);

        $this->_relations[$relation->getAlias()] = $relation;
        $this->_aliases[$relation->getRelatedClass()] = $relation->getAlias();
        $this->reserved[] = $relation->getAlias();

        $this->on('relation', $relation);

        return $this;
    }
public function addRelation ( Relation $ relation ) { $ relation -> setPrimaryModel ( $ this ) ; $ this -> _relations [ $ relation -> getAlias ( ) ] = $ relation ; $ this -> _aliases [ $ relation -> getRelatedClass ( ) ] = $ relation -> getAlias ( ) ; $ this -> reserved [ ] = $ relation -> getAlias ( ) ; $ this -> on ( 'relation' , $ relation ) ; return $ this ; }
Add a relation between two models.

@param \Titon\Model\Relation $relation
@return $this
Add a relation between two models .