Knp\Bundle\KnpBundlesBundle\Manager\OwnerManager::findDeveloperBy PHP Method

findDeveloperBy() public method

public findDeveloperBy ( array $data ) : null | Developer
$data array
return null | Knp\Bundle\KnpBundlesBundle\Entity\Developer
    public function findDeveloperBy(array $data)
    {
        return $this->entityManager->getRepository('Knp\\Bundle\\KnpBundlesBundle\\Entity\\Developer')->findOneBy($data);
    }

Usage Example

Example #1
0
 /**
  * {@inheritdoc}
  */
 public function refreshUser(UserInterface $user)
 {
     $refreshedUser = $this->ownerManager->findDeveloperBy(array('id' => $user->getId()));
     if (null === $refreshedUser) {
         throw new UsernameNotFoundException(sprintf('User with ID "%d" could not be reloaded.', $user->getId()));
     }
     return $refreshedUser;
 }