Created
February 10, 2016 21:27
-
-
Save gCardinal/1d869c86c4bf4f7e7b90 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Nous vérifions que l'utilisateur est bien du bon type pour ne pas appeler getLastActivity() sur un objet autre objet User | |
if ($user instanceof User && $user->getLastActivity() < $delay) { | |
$user->setActiveNow(); | |
$this->em->flush($user); | |
} | |
// Pourquoi tu met un commentaire? Fais une méthode pour me l'expliquer. | |
function userIsRightType($user User, $delay) { | |
return $user instanceof User && $user->getLastActivity() < $delay; | |
} | |
if ($this->userIsRightType($user, $delay)) { | |
$user->setActiveNow(); | |
$this->em->flush($user); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment