These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace NerdsAndCompany\Schematic\Models; |
||
4 | |||
5 | use Craft\BaseModel as Base; |
||
6 | |||
7 | /** |
||
8 | * Schematic Result Model. |
||
9 | * |
||
10 | * Encapsulates the result of an action, including error messages. |
||
11 | * |
||
12 | * @author Nerds & Company |
||
13 | * @copyright Copyright (c) 2015, Nerds & Company |
||
14 | * @license MIT |
||
15 | * |
||
16 | * @link http://www.nerds.company |
||
17 | */ |
||
18 | class Result extends Base |
||
19 | { |
||
20 | /** |
||
21 | * Consumes the errors listed in an existing result and appends them to this result. |
||
22 | * |
||
23 | * @param Result $result The result to consume. |
||
24 | */ |
||
25 | public function consume(Result $result) |
||
26 | { |
||
27 | if ($result->hasErrors('errors')) { |
||
28 | $this->addErrors(['errors' => $result->getErrors('errors'])); |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
29 | } |
||
30 | } |
||
31 | } |
||
32 |