bakaphp /
phalcon-api
| 1 | <?php |
||
|
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||
| 2 | declare(strict_types=1); |
||
| 3 | |||
| 4 | namespace Gewaer\Api\Controllers; |
||
| 5 | |||
| 6 | use Gewaer\Models\Roles; |
||
| 7 | |||
| 8 | /** |
||
| 9 | * Base controller |
||
| 10 | * |
||
| 11 | */ |
||
| 12 | class RolesController extends BaseController |
||
| 13 | {
|
||
| 14 | /* |
||
| 15 | * fields we accept to create |
||
| 16 | * |
||
| 17 | * @var array |
||
| 18 | */ |
||
| 19 | protected $createFields = []; |
||
| 20 | |||
| 21 | /* |
||
| 22 | * fields we accept to create |
||
| 23 | * |
||
| 24 | * @var array |
||
| 25 | */ |
||
| 26 | protected $updateFields = []; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * set objects |
||
| 30 | * |
||
| 31 | * @return void |
||
| 32 | */ |
||
| 33 | public function onConstruct() |
||
| 34 | {
|
||
| 35 | $this->model = new Roles(); |
||
| 36 | |||
| 37 | //get the list of roes for the systema + my company |
||
| 38 | $this->additionalSearchFields = [ |
||
| 39 | ['is_deleted', ':', 0], |
||
| 40 | ['company_id', ':', '(0,' . $this->userData->default_company . ')'], |
||
| 41 | ]; |
||
| 42 | } |
||
| 43 | } |
||
| 44 |