Created
January 16, 2019 21:31
-
-
Save Modicrumb/2f944df2a9065c1258b7331aa201a60e 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 | |
$entities = $this->Servers->find() | |
->contain('Defines', function($q) use ($service) { | |
return $q | |
->contain(['Environments', 'Services']) | |
->where(['Environments.name' => $this->envName]) | |
->where(['Services.name' => $service]); | |
}); | |
$entities = $this->Servers->find() | |
->contain( | |
[ | |
'Defines' => [ | |
'Environments' => [ | |
'queryBuilder' => function ($q) { | |
return $q->where(['Environments.name' => $this->envName]); | |
} | |
], | |
'Services' => [ | |
] | |
] | |
] | |
); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment