/**
  * @param Company $company
  * @return array
  */
 protected function toJson(Company $company)
 {
     return array('id' => $company->getId(), 'socialId' => $company->getSocialId(), 'name' => $company->getName(), 'email' => $company->getEmail(), 'phone' => $company->getPhone(), 'website' => $company->getWebsite(), 'twitterId' => $company->getTwitterId(), 'fanpage' => $company->getFanpage());
 }
Esempio n. 2
0
 /**
  * @param string $socialId
  * @param string $name
  * @param string $logo
  * @param string $email
  * @param string $phone
  * @param string $website
  * @param string $twitterId
  * @param string $fanpage
  * @return Company
  */
 public function create($socialId, $name, $logo, $email, $phone, $website, $twitterId, $fanpage)
 {
     $company = new Company();
     $company->setSocialId($socialId);
     $company->setName($name);
     $company->setLogo($this->createLogo($logo));
     $company->setEmail($email);
     $company->setPhone($phone);
     $company->setWebsite($website);
     $company->setTwitterId($twitterId);
     $company->setFanpage($fanpage);
     $company->setCreationTime(new DateTime());
     return $company;
 }