protected _appendJunctionJoin ( |
||
$query | The query to append. | |
$conditions | string | array | The query conditions to use. |
리턴 | The modified query. |
protected function _appendJunctionJoin($query, $conditions)
{
$name = $this->_junctionAssociationName();
$joins = $query->join();
$matching = [$name => ['table' => $this->junction()->table(), 'conditions' => $conditions, 'type' => 'INNER']];
$assoc = $this->target()->association($name);
$query->addDefaultTypes($assoc->target())->join($matching + $joins, [], true);
return $query;
}