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