Inheritance: implements Sulu\Bundle\ContactBundle\Contact\AccountFactoryInterface
Esempio n. 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;
 }
Esempio n. 2
0
 /**
  * Takes a account entity and a locale and returns the api object.
  *
  * @param Account $account
  * @param string $locale
  *
  * @return AccountApi
  */
 protected function getApiObject($account, $locale)
 {
     $apiObject = $this->accountFactory->createApiEntity($account, $locale);
     if ($account->getLogo()) {
         $apiLogo = $this->mediaManager->getById($account->getLogo()->getId(), $locale);
         $apiObject->setLogo($apiLogo);
     }
     return $apiObject;
 }