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;
}