first commit
This commit is contained in:
29
bundles/KupShop/UserBundle/Repository/UserRepository.php
Normal file
29
bundles/KupShop/UserBundle/Repository/UserRepository.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace KupShop\UserBundle\Repository;
|
||||
|
||||
use KupShop\UserBundle\Entity\User;
|
||||
|
||||
/**
|
||||
* UserRepository.
|
||||
*
|
||||
* This class was generated by the Doctrine ORM. Add your own custom
|
||||
* repository methods below.
|
||||
*/
|
||||
class UserRepository extends \Doctrine\ORM\EntityRepository
|
||||
{
|
||||
/**
|
||||
* @return User
|
||||
*/
|
||||
public function getCurrentUser()
|
||||
{
|
||||
// TODO: Use some wrapper
|
||||
global $ctrl;
|
||||
|
||||
if (!$ctrl['logged']) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $this->findOneBy(['id' => $ctrl['id']]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user