Skip to content
Permalink
Browse files

Add missing method to interface via annotations

  • Loading branch information...
dereuromark committed Sep 25, 2017
1 parent cfa55f2 commit c3c9e9638b93e54c56614aedd6ada622aa02f2b7
Showing with 6 additions and 5 deletions.
  1. +1 −0 src/Datasource/QueryInterface.php
  2. +5 −5 src/ORM/Behavior/TranslateBehavior.php
@@ -19,6 +19,7 @@
* The basis for every query object
*
* @method $this andWhere($conditions, $types = [])
* @method $this select($fields = [], $overwrite = false)
*/
interface QueryInterface
{
@@ -213,19 +213,19 @@ public function beforeFind(Event $event, Query $query, $options)
}
$conditions = function ($field, $locale, $query, $select) {
return function ($query) use ($field, $locale, $query, $select) {
/* @var \Cake\Datasource\QueryInterface $query */
$query->where([$query->repository()->aliasField('locale') => $locale]);
return function ($q) use ($field, $locale, $query, $select) {
/* @var \Cake\Datasource\QueryInterface $q */
$q->where([$q->repository()->aliasField('locale') => $locale]);
/* @var \Cake\ORM\Query $query */
if ($query->isAutoFieldsEnabled() ||
in_array($field, $select, true) ||
in_array($this->_table->aliasField($field), $select, true)
) {
$query->select(['id', 'content']);
$q->select(['id', 'content']);
}
return $query;
return $q;
};
};

0 comments on commit c3c9e96

Please sign in to comment.
You can’t perform that action at this time.