| Total Complexity | 3 |
| Total Lines | 84 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class AccessList extends AbstractModel |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * |
||
| 11 | * @var string |
||
| 12 | */ |
||
| 13 | public $roles_name; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | public $resource_name; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * |
||
| 23 | * @var string |
||
| 24 | */ |
||
| 25 | public $access_name; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * |
||
| 29 | * @var integer |
||
| 30 | */ |
||
| 31 | public $allowed; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * |
||
| 35 | * @var integer |
||
| 36 | */ |
||
| 37 | public $apps_id; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * |
||
| 41 | * @var string |
||
| 42 | */ |
||
| 43 | public $created_at; |
||
| 44 | |||
| 45 | /** |
||
| 46 | * |
||
| 47 | * @var string |
||
| 48 | */ |
||
| 49 | public $updated_at; |
||
| 50 | |||
| 51 | /** |
||
| 52 | * |
||
| 53 | * @var integer |
||
| 54 | */ |
||
| 55 | public $is_deleted; |
||
| 56 | |||
| 57 | /** |
||
| 58 | * Initialize method for model. |
||
| 59 | */ |
||
| 60 | 7 | public function initialize() |
|
| 61 | { |
||
| 62 | 7 | $this->setSource('access_list'); |
|
| 63 | |||
| 64 | 7 | $this->belongsTo( |
|
| 65 | 7 | 'roles_name', |
|
| 66 | 7 | 'Gewaer\Models\Roles', |
|
| 67 | 7 | 'name', |
|
| 68 | 7 | ['alias' => 'role'] |
|
| 69 | ); |
||
| 70 | 7 | } |
|
| 71 | |||
| 72 | /** |
||
| 73 | * Delete all the accest list records for this given role |
||
| 74 | * |
||
| 75 | * @param Roles $role |
||
| 76 | * @return void |
||
| 77 | */ |
||
| 78 | 1 | public static function deleteAllByRole(Roles $role): bool |
|
| 81 | } |
||
| 82 | |||
| 83 | /** |
||
| 84 | * Returns table name mapped in the model. |
||
| 85 | * |
||
| 86 | * @return string |
||
| 87 | */ |
||
| 88 | 7 | public function getSource(): string |
|
| 93 |