Advertisement
Guest User

Untitled

a guest
Jan 5th, 2015
69
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php namespace Latheesan\Repo\Session;
  2.  
  3. use Cartalyst\Sentry\Sentry;
  4. use Latheesan\Repo\RepoAbstract;
  5.  
  6. class SentrySession extends RepoAbstract implements SessionInterface {
  7.  
  8.     /**
  9.      * @var Sentry
  10.      */
  11.     protected $sentry;
  12.  
  13.     /**
  14.      * @var \Cartalyst\Sentry\Throttling\ProviderInterface
  15.      */
  16.     protected $throttleProvider;
  17.  
  18.     /**
  19.      * @param Sentry $sentry
  20.      */
  21.     public function __construct(Sentry $sentry)
  22.     {
  23.         // Sentry instance
  24.         $this->sentry = $sentry;
  25.  
  26.         // Get the Throttle Provider
  27.         $this->throttleProvider = $this->sentry->getThrottleProvider();
  28.  
  29.         // Enable the Throttling Feature
  30.         $this->throttleProvider->enable();
  31.     }
  32.  
  33.     /**
  34.      * Store a newly created resource in storage.
  35.      *
  36.      * @param $data
  37.      * @return Response
  38.      */
  39.     public function store($data)
  40.     {
  41.         // snipped
  42.     }
  43.  
  44.     /**
  45.      * Remove the specified resource from storage.
  46.      *
  47.      * @return Response
  48.      */
  49.     public function destroy()
  50.     {
  51.         $this->sentry->logout();
  52.     }
  53.  
  54. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement