Blame view

app/library/App/Resources/AllPositionResource.php 776 Bytes
b660745b   Alex Savenko   git bug
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
  <?php
  /**
   * Created by PhpStorm.
   * User: Alex Savenko
   * Date: 22.02.2017
   * Time: 20:29
   */
  
  namespace App\Resources;
  
  
  use App\Controllers\AllPositionController;
  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.')
              )
          ;
  
      }
  
  }