@@ -66,8 +66,8 @@ public function cancel($token)
6666 $ hash = hash ($ this ->algorithm , $ token );
6767
6868 // Find an incomplete reset request for the specified hash
69- $ model = $ this ->classMapper
70- -> staticMethod ( $ this -> modelIdentifier , ' where ' , 'hash ' , $ hash )
69+ $ model = $ this ->classMapper -> getClassMapping ( $ this -> modelIdentifier )
70+ :: where ( 'hash ' , $ hash )
7171 ->where ('completed ' , false )
7272 ->first ();
7373
@@ -94,8 +94,8 @@ public function complete($token, $userParams = [])
9494 $ hash = hash ($ this ->algorithm , $ token );
9595
9696 // Find an unexpired, incomplete token for the specified hash
97- $ model = $ this ->classMapper
98- -> staticMethod ( $ this -> modelIdentifier , ' where ' , 'hash ' , $ hash )
97+ $ model = $ this ->classMapper -> getClassMapping ( $ this -> modelIdentifier )
98+ :: where ( 'hash ' , $ hash )
9999 ->where ('completed ' , false )
100100 ->where ('expires_at ' , '> ' , Carbon::now ())
101101 ->first ();
@@ -105,7 +105,7 @@ public function complete($token, $userParams = [])
105105 }
106106
107107 // Fetch user for this token
108- $ user = $ this ->classMapper ->staticMethod ('user ' , ' find ' , $ model ->user_id );
108+ $ user = $ this ->classMapper ->getClassMapping ('user ' ):: find ( $ model ->user_id );
109109
110110 if (is_null ($ user )) {
111111 return false ;
@@ -170,8 +170,8 @@ public function create(UserInterface $user, $timeout)
170170 */
171171 public function exists (UserInterface $ user , $ token = null )
172172 {
173- $ model = $ this ->classMapper
174- -> staticMethod ( $ this -> modelIdentifier , ' where ' , 'user_id ' , $ user ->id )
173+ $ model = $ this ->classMapper -> getClassMapping ( $ this -> modelIdentifier )
174+ :: where ( 'user_id ' , $ user ->id )
175175 ->where ('completed ' , false )
176176 ->where ('expires_at ' , '> ' , Carbon::now ());
177177
@@ -193,8 +193,8 @@ public function exists(UserInterface $user, $token = null)
193193 */
194194 protected function removeExisting (UserInterface $ user )
195195 {
196- return $ this ->classMapper
197- -> staticMethod ( $ this -> modelIdentifier , ' where ' , 'user_id ' , $ user ->id )
196+ return $ this ->classMapper -> getClassMapping ( $ this -> modelIdentifier )
197+ :: where ( 'user_id ' , $ user ->id )
198198 ->delete ();
199199 }
200200
@@ -205,8 +205,8 @@ protected function removeExisting(UserInterface $user)
205205 */
206206 public function removeExpired ()
207207 {
208- return $ this ->classMapper
209- -> staticMethod ( $ this -> modelIdentifier , ' where ' , 'completed ' , false )
208+ return $ this ->classMapper -> getClassMapping ( $ this -> modelIdentifier )
209+ :: where ( 'completed ' , false )
210210 ->where ('expires_at ' , '< ' , Carbon::now ())
211211 ->delete ();
212212 }
@@ -224,8 +224,8 @@ protected function generateRandomToken($gen = null)
224224 {
225225 do {
226226 $ gen = md5 (uniqid (mt_rand (), false ));
227- } while ($ this ->classMapper
228- -> staticMethod ( $ this -> modelIdentifier , ' where ' , 'hash ' , hash ($ this ->algorithm , $ gen ))
227+ } while ($ this ->classMapper -> getClassMapping ( $ this -> modelIdentifier )
228+ :: where ( 'hash ' , hash ($ this ->algorithm , $ gen ))
229229 ->first ());
230230
231231 return $ gen ;
0 commit comments