protected function _appendJunctionJoin($query, $conditions)
    {
        $name = $this->_junctionAssociationName();
        /** @var array $joins */
        $joins = $query->clause('join');
        $matching = [
            $name => [
                'table' => $this->junction()->getTable(),
                'conditions' => $conditions,
                'type' => QueryInterface::JOIN_TYPE_INNER
            ]
        ];

        $assoc = $this->getTarget()->getAssociation($name);
        $query
            ->addDefaultTypes($assoc->getTarget())
            ->join($matching + $joins, [], true);

        return $query;
    }
protected function _appendJunctionJoin($query, $conditions)
    {
        $name = $this->_junctionAssociationName();
        /** @var array $joins */
        $joins = $query->clause('join');
        $matching = [
            $name => [
                'table' => $this->junction()->getTable(),
                'conditions' => $conditions,
                'type' => QueryInterface::JOIN_TYPE_INNER
            ]
        ];

        $assoc = $this->getTarget()->getAssociation($name);
        $query
            ->addDefaultTypes($assoc->getTarget())
            ->join($matching + $joins, [], true);

        return $query;
    }
protected function _appendJunctionJoin ( $ query , $ conditions ) { $ name = $ this -> _junctionAssociationName ( ) ; /** @var array $joins */ $ joins = $ query -> clause ( 'join' ) ; $ matching = [ $ name => [ 'table' => $ this -> junction ( ) -> getTable ( ) , 'conditions' => $ conditions , 'type' => QueryInterface :: JOIN_TYPE_INNER ] ] ; $ assoc = $ this -> getTarget ( ) -> getAssociation ( $ name ) ; $ query -> addDefaultTypes ( $ assoc -> getTarget ( ) ) -> join ( $ matching + $ joins , [ ] , true ) ; return $ query ; }
Append a join to the junction table.

@param \Cake\ORM\Query $query The query to append.
@param string|array $conditions The query conditions to use.
@return \Cake\ORM\Query The modified query.
Append a join to the junction table .