Created
April 11, 2017 16:15
-
-
Save Theaxiom/39f4af4fabd339ca9fd2e37afe212194 to your computer and use it in GitHub Desktop.
Extending view method
This file contains hidden or 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 | |
namespace App\Controller\Api; | |
/** | |
* Releases Controller | |
* | |
* @property \App\Model\Table\ReleasesTable $Releases | |
*/ | |
class ReleasesController extends ApiAppController | |
{ | |
public function full($id) | |
{ | |
$this->Crud->on('beforeFind', function(\Cake\Event\Event $event) { | |
$event->getSubject()->query->contain([ | |
'Builds', | |
'Products', | |
'Builds.Artifacts' | |
]); | |
}); | |
return $this->Crud->execute(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment