| Total Complexity | 4 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class FormContentRestore extends Model |
||
| 13 | { |
||
| 14 | public $id; |
||
| 15 | public $title; |
||
| 16 | |||
| 17 | private $_record; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * FormContentRestore constructor. Pass active record object inside |
||
| 21 | * @param Content $record |
||
| 22 | */ |
||
| 23 | public function __construct(Content $record) |
||
| 24 | { |
||
| 25 | $this->_record = $record; |
||
| 26 | parent::__construct(); |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Set public attributes from active record object |
||
| 31 | */ |
||
| 32 | public function before() |
||
| 33 | { |
||
| 34 | $this->id = $this->_record->id; |
||
| 35 | $this->title = $this->_record->getLocaled('title'); |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Form display labels |
||
| 40 | * @return array |
||
| 41 | */ |
||
| 42 | public function labels(): array |
||
| 46 | ]; |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Make restore of trashed item |
||
| 51 | */ |
||
| 52 | public function make() |
||
| 55 | } |
||
| 56 | } |
||
| 57 |