Пример #1
0
 /**
  * Returns data to render template.
  *
  * @param array $options
  *
  * @throws WidgetException
  *
  * @return array
  */
 public function getData($options)
 {
     if (!empty($options) && array_key_exists('contact', $options) && !empty($options['contact'])) {
         $id = $options['contact'];
         $contact = $this->contactRepository->find($id);
         if (!$contact) {
             throw new WidgetEntityNotFoundException('Entity ' . $this->contactRepository->getClassName() . ' with id ' . $id . ' not found!', $this->widgetName, $id);
         }
         return $this->parseMainContact($contact);
     }
     return null;
 }
Пример #2
0
 /**
  * @return string
  */
 public function getContactEntityName()
 {
     return $this->contactRepository->getClassName();
 }