Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?PHP
- namespace App\Contracts;
- use App\Entities\ApiKey;
- interface ApiKeyContract
- {
- /**
- * Return ApiKey model
- *
- * @return ApiKey
- */
- public function entity();
- /**
- * Find all keys
- *
- * @return \Illuminate\Database\Eloquent\Collection
- */
- public function findAll();
- /**
- * Find active keys
- *
- * @return \Illuminate\Database\Eloquent\Collection
- */
- public function findActive();
- /**
- * Find archived answers
- *
- * @return \Illuminate\Database\Eloquent\Collection
- */
- public function findArchived();
- /**
- * Find specified api key by ID
- *
- * @param integer $id
- * @return ApiKey|null
- */
- public function findById($id);
- /**
- * Find specified api key by key
- *
- * @param integer $key
- * @return ApiKey|null
- */
- public function findByKey($key);
- /**
- * Create new api key and save to database
- *
- * @param array $data
- * @return ApiKey|false
- */
- public function create($data = []);
- /**
- * Update specific api key
- *
- * @param ApiKey $apiKey
- * @param array $data
- * @return boolean
- */
- public function update(ApiKey $apiKey, $data = []);
- /**
- * Move to archive specified api key (soft delete)
- *
- * @param ApiKey $apiKey
- * @return boolean
- */
- public function archive(ApiKey $apiKey);
- /**
- * Restore archived api key (soft deleted)
- *
- * @param ApiKey $apiKey
- * @return boolean
- */
- public function restore(ApiKey $apiKey);
- /**
- * Complete remove specific api key from database
- *
- * @param ApiKey $apiKey
- * @return void
- */
- public function forceDelete(ApiKey $apiKey);
- }
Add Comment
Please, Sign In to add comment