Bristol SU Support Package
ActivityInstanceProvider.php
Go to the documentation of this file.
1 <?php
3 
9 
13 class ActivityInstanceProvider implements UserProvider
14 {
15 
21  private $repository;
22 
29  {
30  $this->repository = $repository;
31  }
32 
39  public function retrieveById($identifier)
40  {
41  return $this->repository->getById($identifier);
42 
43  }
44 
53  public function retrieveByToken($identifier, $token)
54  {
55  return null;
56  }
57 
65  public function updateRememberToken(Authenticatable $activityInstance, $token)
66  {
67  return null;
68  }
69 
81  public function retrieveByCredentials(array $credentials)
82  {
83  if (isset($credentials['activity_instance_id'])) {
84  try {
85  return $this->retrieveById($credentials['activity_instance_id']);
86  } catch (ModelNotFoundException $e) {}
87  }
88  return null;
89  }
90 
103  public function validateCredentials(Authenticatable $user, array $credentials)
104  {
105  if (isset($credentials['activity_instance_id'])) {
106  try {
107  $this->retrieveById($credentials['activity_instance_id']);
108  return true;
109  } catch (\Exception $e) {
110  }
111  }
112  return false;
113  }
114 }