Weitere ähnliche Inhalte Ähnlich wie CakePHP 3.0 and beyond (20) Kürzlich hochgeladen (20) CakePHP 3.0 and beyond21. Shell Helpers
$func = function ($progress) {
// Do work
$progress->increment();
};
$this->helper(‘progress’)->output($func);
$progress = $this->helper('progress');
// Progress through 300 things
$progress->init(['total' => 300]);
$progress->increment($i);
$progress->draw();
23. ORM Improvements
// Lazy eager loading
$articles = $this->Articles->find()->all();
$enrichedArticles = $this->Articles->eagerLoad(
$articles,
['Users', 'Tags']
);
// Not matching - find bookmarks not tagged with X
$query = $this->Bookmarks->find()
->notMatching('Tags', function ($q) {
return $q->where(['Tags.name' => 'Awesome']);
});
29. Backwards
Compatible
• Public methods won’t change their signatures.
• Public properties will continue to be available.
• Protected methods may change signatures.
• Protected properties may change.