Created
January 19, 2016 20:38
-
-
Save styks1987/ecf46edaf82e93d6630f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$following = $this->Strategies->Users | |
->matching( | |
'FollowingAgencies.Employees' | |
) | |
->where(['Users.id' => $this->Auth->user('id')])->toArray(); | |
$following = Hash::extract($following, '{n}._matchingData.Employees.id'); | |
$query = $this->Strategies->find('open') | |
->order(['Strategies.created DESC']) | |
->contain([ | |
'Users.Agencies', | |
'Assisting' => function ($q){ | |
return $q->order(['Assisting.last_name ASC', 'Assisting.first_name ASC']); | |
}]) | |
->where(['Strategies.user_id IN' => $following]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment