Skip to content
Permalink
Browse files

Add EagerLoader::disableAutoFields() and Query::disableAutoFields().

  • Loading branch information...
ADmad committed Nov 1, 2018
1 parent 8d579fa commit 1db4d7e51db57a2e9036f5e2685d6c226710255b
Showing with 25 additions and 1 deletion.
  1. +1 −1 src/ORM/Association/Loader/SelectLoader.php
  2. +12 −0 src/ORM/EagerLoader.php
  3. +12 −0 src/ORM/Query.php
@@ -396,7 +396,7 @@ protected function _linkField($options)
protected function _buildSubquery($query)
{
$filterQuery = clone $query;
$filterQuery->enableAutoFields(false);
$filterQuery->disableAutoFields();
$filterQuery->mapReduce(null, null, true);
$filterQuery->formatResults(null, true);
$filterQuery->contain([], true);
@@ -209,6 +209,18 @@ public function enableAutoFields($enable = true)
return $this;
}
/**
* Disable auto loading fields of contained associations.
*
* @return $this
*/
public function disableAutoFields()
{
$this->_autoFields = false;
return $this;
}
/**
* Gets whether or not contained associations will load fields automatically.
*
@@ -1374,6 +1374,18 @@ public function enableAutoFields($value = true)
return $this;
}
/**
* Disables automatically appending fields.
*
* @return $this
*/
public function disableAutoFields()
{
$this->_autoFields = false;
return $this;
}
/**
* Gets whether or not the ORM should automatically append fields.
*

0 comments on commit 1db4d7e

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