zalazdi

Untitled

Mar 8th, 2016
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.83 KB | None | 0 0
  1. <?PHP
  2.  
  3. namespace App\Contracts;
  4.  
  5. use App\Entities\ApiKey;
  6.  
  7. interface ApiKeyContract
  8. {
  9.     /**
  10.      * Return ApiKey model
  11.      *
  12.      * @return ApiKey
  13.      */
  14.     public function entity();
  15.  
  16.     /**
  17.      * Find all keys
  18.      *
  19.      * @return \Illuminate\Database\Eloquent\Collection
  20.      */
  21.     public function findAll();
  22.  
  23.     /**
  24.      * Find active keys
  25.      *
  26.      * @return \Illuminate\Database\Eloquent\Collection
  27.      */
  28.     public function findActive();
  29.  
  30.     /**
  31.      * Find archived answers
  32.      *
  33.      * @return \Illuminate\Database\Eloquent\Collection
  34.      */
  35.     public function findArchived();
  36.  
  37.     /**
  38.      * Find specified api key by ID
  39.      *
  40.      * @param integer $id
  41.      * @return ApiKey|null
  42.      */
  43.     public function findById($id);
  44.  
  45.     /**
  46.      * Find specified api key by key
  47.      *
  48.      * @param integer $key
  49.      * @return ApiKey|null
  50.      */
  51.     public function findByKey($key);
  52.  
  53.     /**
  54.      * Create new api key and save to database
  55.      *
  56.      * @param array $data
  57.      * @return ApiKey|false
  58.      */
  59.     public function create($data = []);
  60.  
  61.     /**
  62.      * Update specific api key
  63.      *
  64.      * @param ApiKey $apiKey
  65.      * @param array $data
  66.      * @return boolean
  67.      */
  68.     public function update(ApiKey $apiKey, $data = []);
  69.  
  70.     /**
  71.      * Move to archive specified api key (soft delete)
  72.      *
  73.      * @param ApiKey $apiKey
  74.      * @return boolean
  75.      */
  76.     public function archive(ApiKey $apiKey);
  77.  
  78.     /**
  79.      * Restore archived api key (soft deleted)
  80.      *
  81.      * @param ApiKey $apiKey
  82.      * @return boolean
  83.      */
  84.     public function restore(ApiKey $apiKey);
  85.  
  86.     /**
  87.      * Complete remove specific api key from database
  88.      *
  89.      * @param ApiKey $apiKey
  90.      * @return void
  91.      */
  92.     public function forceDelete(ApiKey $apiKey);
  93. }
Add Comment
Please, Sign In to add comment