| @@ 270-280 (lines=11) @@ | ||
| 267 | * |
|
| 268 | * @return \samsoncms\api\Entity First matching entity |
|
| 269 | */ |
|
| 270 | public function first() |
|
| 271 | { |
|
| 272 | // Proxy to regular database query |
|
| 273 | $return = $this->query |
|
| 274 | ->entity(static::$identifier) |
|
| 275 | ->limit(1) |
|
| 276 | ->whereCondition($this->conditions) |
|
| 277 | ->exec(); |
|
| 278 | ||
| 279 | return array_shift($return); |
|
| 280 | } |
|
| 281 | ||
| 282 | /** |
|
| 283 | * Perform SamsonCMS query and get amount resulting entities. |
|
| @@ 198-208 (lines=11) @@ | ||
| 195 | * |
|
| 196 | * @return \samsoncms\api\Entity First matching entity |
|
| 197 | */ |
|
| 198 | public function first() |
|
| 199 | { |
|
| 200 | // Proxy to regular database query |
|
| 201 | $return = $this->query |
|
| 202 | ->entity(static::$identifier) |
|
| 203 | ->limit(1) |
|
| 204 | ->whereCondition($this->conditions) |
|
| 205 | ->exec(); |
|
| 206 | ||
| 207 | return array_shift($return); |
|
| 208 | } |
|
| 209 | ||
| 210 | /** |
|
| 211 | * Perform SamsonCMS query and get amount resulting entities. |
|