Blame view

app/library/App/Resources/AllPositionResource.php 837 Bytes
b660745b   Alex Savenko   git bug
1
2
3
4
5
6
7
8
9
10
11
  <?php
  /**
   * Created by PhpStorm.
   * User: Alex Savenko
   * Date: 22.02.2017
   * Time: 20:29
   */
  
  namespace App\Resources;
  
  
056ab121   Alex Savenko   ga fix
12
  use App\Constants\AclRoles;
b660745b   Alex Savenko   git bug
13
  use App\Controllers\AllPositionController;
056ab121   Alex Savenko   ga fix
14
  use PhalconRest\Api\ApiEndpoint;
b660745b   Alex Savenko   git bug
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
  use PhalconRest\Api\ApiResource;
  
  class AllPositionResource extends ApiResource
  {
  
      public function initialize() {
  
          $this
              ->name('All Position')
              ->expectsJsonData()
              //->transformer(ModelTransformer::class)
              ->itemKey('ap')
              ->collectionKey('ap')
              ->deny(AclRoles::UNAUTHORIZED)
              ->handler(AllPositionController::class)
  
              ->endpoint(ApiEndpoint::get('', 'testAction')
                  ->allow(AclRoles::USER)
                  ->description('Returns data from AllPosition Api.')
              )
          ;
  
      }
  
  }