Ouzo\Db\Relation::getCondition PHP Метод

getCondition() публичный Метод

public getCondition ( )
    public function getCondition()
    {
        if (is_callable($this->condition)) {
            return call_user_func($this->condition);
        }
        return WhereClause::create($this->condition);
    }

Usage Example

Пример #1
0
 public function asJoinClause()
 {
     $joinedModel = $this->relation->getRelationModelObject();
     $joinTable = $joinedModel->getTableName();
     $joinKey = $this->relation->getForeignKey();
     $idName = $this->relation->getLocalKey();
     $onClauses = array(WhereClause::create($this->on), $this->relation->getCondition());
     return new JoinClause($joinTable, $joinKey, $idName, $this->fromTable, $this->alias, $this->type, $onClauses);
 }