Skip to content
Permalink
Browse files

CS fixes

  • Loading branch information...
lorenzo committed Oct 10, 2016
1 parent dbbf698 commit abd13e5b7e9e2c2daa586befa0b4ebdd87c6f179
@@ -188,7 +188,8 @@ protected function _joinCondition($options)
*
* @return callable
*/
public function eagerLoader(array $options) {
public function eagerLoader(array $options)
{
$loader = new SelectLoader([
'alias' => $this->alias(),
'sourceAlias' => $this->source()->alias(),
@@ -506,7 +506,8 @@ protected function _joinCondition($options)
*
* @return callable
*/
public function eagerLoader(array $options) {
public function eagerLoader(array $options)
{
$name = $this->_junctionAssociationName();
$loader = new SelectWithPivotLoader([
'alias' => $this->alias(),
@@ -519,11 +520,10 @@ public function eagerLoader(array $options) {
'sort' => $this->sort(),
'junctionAssociationName' => $name,
'junctionProperty' => $this->_junctionProperty,
'junctionAssoc' => $this->target()->association($name),
'junctionAssoc' => $this->target()->association($name),
'junctionConditions' => $this->junctionConditions(),
'finder' => function () {
$query = $this->find();
return $this->_appendJunctionJoin($query, []);
return $this->_appendJunctionJoin($this->find(), []);
}
]);
@@ -588,7 +588,8 @@ protected function _options(array $opts)
*
* @return callable
*/
public function eagerLoader(array $options) {
public function eagerLoader(array $options)
{
$loader = new SelectLoader([
'alias' => $this->alias(),
'sourceAlias' => $this->source()->alias(),
@@ -133,7 +133,8 @@ public function saveAssociated(EntityInterface $entity, array $options = [])
*
* @return callable
*/
public function eagerLoader(array $options) {
public function eagerLoader(array $options)
{
$loader = new SelectLoader([
'alias' => $this->alias(),
'sourceAlias' => $this->source()->alias(),
@@ -17,8 +17,8 @@
use Cake\Database\Expression\IdentifierExpression;
use Cake\Database\Expression\TupleComparison;
use Cake\Database\ValueBinder;
use InvalidArgumentException;
use Cake\ORM\Association;
use InvalidArgumentException;
use RuntimeException;
/**
@@ -94,6 +94,7 @@ class SelectLoader
* Copies the options array to properties in this class. The keys in the array correspond
* to properties in this class.
*
* @param array $options Properties to be copied to this class
*/
public function __construct(array $options)
{
@@ -245,7 +246,7 @@ protected function _assertFieldsPresent($fetchQuery, $key)
* @param \Cake\ORM\Query $subquery The Subquery to use for filtering
* @return \Cake\ORM\Query
*/
public function _addFilteringJoin($query, $key, $subquery)
protected function _addFilteringJoin($query, $key, $subquery)
{
$filter = [];
$aliasedTable = $this->sourceAlias;
@@ -55,9 +55,10 @@ class SelectWithPivotLoader extends SelectLoader
* {@inheritDoc}
*
*/
public function __construct(array $options) {
public function __construct(array $options)
{
parent::__construct($options);
$this->junctionAssociationName = $options['junctionAssociationName'];
$this->junctionAssociationName = $options['junctionAssociationName'];
$this->junctionProperty = $options['junctionProperty'];
$this->junctionAssoc = $options['junctionAssoc'];
$this->junctionConditions = $options['junctionConditions'];

0 comments on commit abd13e5

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