src/services/Model.php 1 location
|
@@ 346-356 (lines=11) @@
|
| 343 |
|
* @param string $toScenario |
| 344 |
|
* @return BaseModel|null |
| 345 |
|
*/ |
| 346 |
|
public function findByQuery(QueryInterface $query, string $toScenario = null) |
| 347 |
|
{ |
| 348 |
|
|
| 349 |
|
/** @var Record $record */ |
| 350 |
|
if (!$record = $query->one()) { |
| 351 |
|
return null; |
| 352 |
|
} |
| 353 |
|
|
| 354 |
|
return $this->findByRecord($record, $toScenario); |
| 355 |
|
|
| 356 |
|
} |
| 357 |
|
|
| 358 |
|
/******************************************* |
| 359 |
|
* FIND/GET BY CONDITION |
src/services/Object.php 1 location
|
@@ 343-353 (lines=11) @@
|
| 340 |
|
* @param string $toScenario |
| 341 |
|
* @return BaseObject|null |
| 342 |
|
*/ |
| 343 |
|
public function findByQuery(QueryInterface $query, string $toScenario = null) |
| 344 |
|
{ |
| 345 |
|
|
| 346 |
|
/** @var Record $record */ |
| 347 |
|
if (!$record = $query->one()) { |
| 348 |
|
return null; |
| 349 |
|
} |
| 350 |
|
|
| 351 |
|
return $this->findByRecord($record, $toScenario); |
| 352 |
|
|
| 353 |
|
} |
| 354 |
|
|
| 355 |
|
/******************************************* |
| 356 |
|
* FIND/GET BY CONDITION |