Sulu\Bundle\ContactBundle\Contact\AccountFactory::createApiEntity PHP Method

createApiEntity() public method

public createApiEntity ( Sulu\Bundle\ContactBundle\Entity\AccountInterface $account, $locale )
$account Sulu\Bundle\ContactBundle\Entity\AccountInterface
    public function createApiEntity(AccountInterface $account, $locale)
    {
        return new AccountApi($account, $locale);
    }

Usage Example

Beispiel #1
0
 /**
  * Returns an api entity for an doctrine entity.
  *
  * @param $account
  * @param $locale
  *
  * @return null|Account
  */
 public function getAccount($account, $locale)
 {
     if ($account) {
         return $this->accountFactory->createApiEntity($account, $locale);
     }
     return;
 }
All Usage Examples Of Sulu\Bundle\ContactBundle\Contact\AccountFactory::createApiEntity