Skip to content

Instantly share code, notes, and snippets.

@DavidGarciaCat
Last active February 27, 2018 11:14
Show Gist options
  • Save DavidGarciaCat/c2703c266e42649a60cfa91ad11829c6 to your computer and use it in GitHub Desktop.
Save DavidGarciaCat/c2703c266e42649a60cfa91ad11829c6 to your computer and use it in GitHub Desktop.
<?php
namespace AppBundle\Entity;
class User extends BaseUser
{
// properties, getters and setters
}
<?php
namespace AppBundle\Controller;
class UserController
{
/**
* @return User[]
*/
public function getUsersAction()
{
return $this->userManager->retrieveUsers();
}
}
<?php
namespace AppBundle\Service;
class UserManager
{
/**
* @return User[]
*/
public function retrieveUsers()
{
$this->userRepository->getAllUsers();
}
}
<?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