src/services/Model.php 1 location
|
@@ 244-254 (lines=11) @@
|
241 |
|
* @param string $toScenario |
242 |
|
* @return BaseModel|null |
243 |
|
*/ |
244 |
|
public function findByQuery(QueryInterface $query, string $toScenario = null) |
245 |
|
{ |
246 |
|
|
247 |
|
/** @var Record $record */ |
248 |
|
if (!$record = $query->one()) { |
249 |
|
return null; |
250 |
|
} |
251 |
|
|
252 |
|
return $this->findByRecord($record, $toScenario); |
253 |
|
|
254 |
|
} |
255 |
|
|
256 |
|
/******************************************* |
257 |
|
* FIND/GET BY CONDITION |
src/services/Object.php 1 location
|
@@ 240-250 (lines=11) @@
|
237 |
|
* @param string $toScenario |
238 |
|
* @return BaseObject|null |
239 |
|
*/ |
240 |
|
public function findByQuery(QueryInterface $query, string $toScenario = null) |
241 |
|
{ |
242 |
|
|
243 |
|
/** @var Record $record */ |
244 |
|
if (!$record = $query->one()) { |
245 |
|
return null; |
246 |
|
} |
247 |
|
|
248 |
|
return $this->findByRecord($record, $toScenario); |
249 |
|
|
250 |
|
} |
251 |
|
|
252 |
|
/******************************************* |
253 |
|
* FIND/GET BY CONDITION |