Cartalyst\Sentinel\Native\SentinelBootstrapper::createSentinel PHP Method

createSentinel() public method

Creates a sentinel instance.
public createSentinel ( ) : Sentinel
return Cartalyst\Sentinel\Sentinel
    public function createSentinel()
    {
        $persistence = $this->createPersistence();
        $users = $this->createUsers();
        $roles = $this->createRoles();
        $activations = $this->createActivations();
        $dispatcher = $this->getEventDispatcher();
        $sentinel = new Sentinel($persistence, $users, $roles, $activations, $dispatcher);
        $throttle = $this->createThrottling();
        $ipAddress = $this->getIpAddress();
        $checkpoints = $this->createCheckpoints($activations, $throttle, $ipAddress);
        foreach ($checkpoints as $key => $checkpoint) {
            $sentinel->addCheckpoint($key, $checkpoint);
        }
        $reminders = $this->createReminders($users);
        $sentinel->setActivationRepository($activations);
        $sentinel->setReminderRepository($reminders);
        $sentinel->setThrottleRepository($throttle);
        return $sentinel;
    }

Usage Example

Beispiel #1
0
 /**
  * Constructor.
  *
  * @param  \Cartalyst\Sentinel\Native\SentinelBootstrapper  $bootstrapper
  * @return void
  */
 public function __construct(SentinelBootstrapper $bootstrapper = null)
 {
     if ($bootstrapper === null) {
         $bootstrapper = new SentinelBootstrapper();
     }
     $this->sentinel = $bootstrapper->createSentinel();
 }
All Usage Examples Of Cartalyst\Sentinel\Native\SentinelBootstrapper::createSentinel