| 1 | <?php |
||
| 27 | class TrashItem extends Document implements TrashInterface |
||
| 28 | { |
||
| 29 | |||
| 30 | use \Maslosoft\Mangan\Traits\Model\TrashableTrait; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Element name |
||
| 34 | * @Label('Name') |
||
| 35 | * @var string |
||
| 36 | */ |
||
| 37 | public $name = ''; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Type of trashed item |
||
| 41 | * @Label('Type') |
||
| 42 | * @var string |
||
| 43 | */ |
||
| 44 | public $type = ''; |
||
| 45 | |||
| 46 | /** |
||
| 47 | * When it was trashed. |
||
| 48 | * @Sanitizer(DateSanitizer) |
||
| 49 | * @see DateSanitizer |
||
| 50 | * @var MongoDate |
||
| 51 | */ |
||
| 52 | public $createDate = ''; |
||
| 53 | |||
| 54 | 4 | public function getCollectionName() |
|
| 58 | |||
| 59 | /** |
||
| 60 | * Purge all items from trash. Returns number of removed items. |
||
| 61 | * @return int |
||
| 62 | */ |
||
| 63 | 3 | public function purge() |
|
| 76 | |||
| 77 | public function __toString() |
||
| 81 | |||
| 82 | } |
||
| 83 |