| Total Complexity | 4 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | trait ModelAwareTrait |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * The source's object model. |
||
| 17 | * |
||
| 18 | * @var ModelInterface |
||
| 19 | */ |
||
| 20 | private $model; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Set the source's model. |
||
| 24 | * |
||
| 25 | * @param ModelInterface $model The source's model. |
||
| 26 | * @return self |
||
| 27 | */ |
||
| 28 | public function setModel(ModelInterface $model) |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Retrieve the source's model. |
||
| 36 | * |
||
| 37 | * @throws RuntimeException If not model was previously set. |
||
| 38 | * @return ModelInterface |
||
| 39 | */ |
||
| 40 | public function model() |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Determine if the source has a model. |
||
| 52 | * |
||
| 53 | * @return boolean |
||
| 54 | */ |
||
| 55 | public function hasModel() |
||
| 60 |