1 | <?php namespace App; |
||
8 | class Training_Resource extends SleepingOwlModel implements ModelWithImageFieldsInterface |
||
9 | { |
||
10 | use ModelWithImageOrFileFieldsTrait; |
||
11 | |||
12 | public $timestamps = true; |
||
13 | |||
14 | |||
15 | /** |
||
16 | * The database table used by the model. |
||
17 | * |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $table = 'training_resource'; |
||
21 | |||
22 | |||
23 | /** |
||
24 | * Primary key of the table |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $primaryKey = 'training_resource_id'; |
||
28 | |||
29 | |||
30 | /** |
||
31 | * The name of the "created at" column. |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | const CREATED_AT = 'training_resource_entryDate'; |
||
36 | |||
37 | |||
38 | /** |
||
39 | * The name of the "updated at" column. |
||
40 | * |
||
41 | * @var string |
||
42 | */ |
||
43 | const UPDATED_AT = 'training_resource_last_update'; |
||
44 | |||
45 | |||
46 | protected $fillable = [ |
||
47 | 'training_resource_name', |
||
48 | 'training_resource_short_name', |
||
49 | 'training_resource_description', |
||
50 | 'training_resource_thumbnail', |
||
51 | 'training_resource_external_url', |
||
52 | 'training_resource_softDeleted', |
||
53 | 'training_resource_parentResourceId' |
||
54 | ]; |
||
55 | |||
56 | |||
57 | protected $hidden = [ |
||
58 | 'training_resource_entryDate', |
||
59 | 'training_resource_last_update' |
||
60 | ]; |
||
61 | |||
62 | |||
63 | /** |
||
64 | * Get array of image field names and its directories within images folder |
||
65 | * |
||
66 | * Keys of array is image field names |
||
67 | * Values is their directories |
||
68 | * |
||
69 | * @return string[] |
||
70 | */ |
||
71 | |||
72 | public function getImageFields() |
||
78 | |||
79 | public function parent() |
||
83 | |||
84 | public function children() |
||
92 | |||
93 | public function getDates() |
||
104 | |||
105 | } |