Logo

first()

ops...

Description

Adds 'LIMIT 1' to a query. Unlike its counterpart 'firstOrFail', it does not throw an excepetion, if it cannot find a specific element. It just returns null.

Usage: $article = $this->Articles->find()->where(['id' => 1])->first();