Last active
February 27, 2018 11:14
-
-
Save DavidGarciaCat/c2703c266e42649a60cfa91ad11829c6 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 | |
namespace AppBundle\Entity; | |
class User extends BaseUser | |
{ | |
// properties, getters and setters | |
} |
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 | |
namespace AppBundle\Controller; | |
class UserController | |
{ | |
/** | |
* @return User[] | |
*/ | |
public function getUsersAction() | |
{ | |
return $this->userManager->retrieveUsers(); | |
} | |
} |
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 | |
namespace AppBundle\Service; | |
class UserManager | |
{ | |
/** | |
* @return User[] | |
*/ | |
public function retrieveUsers() | |
{ | |
$this->userRepository->getAllUsers(); | |
} | |
} |
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 | |
namespace AppBundle\Repository; | |
class UserRepository extends EntityRepository | |
{ | |
/** | |
* @return User[] | |
*/ | |
public function getAllUsers() | |
{ | |
return $this->findAll(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment