public function populateFromObject($object, $add_underscore = true)
 {
     parent::populateFromObject($object, $add_underscore);
     if (!$object instanceof Kaltura_Client_EmailNotification_Type_EmailNotificationTemplate) {
         return;
     }
     $headerNames = array('to', 'cc', 'bcc');
     foreach ($headerNames as $headerName) {
         $this->populateHeaderField($object, $headerName);
     }
 }
 public function populateFromObject($object, $add_underscore = true)
 {
     parent::populateFromObject($object, $add_underscore);
     if (!$object instanceof Kaltura_Client_EmailNotification_Type_EmailNotificationTemplate) {
         return;
     }
     foreach ($object->contentParameters as $parameter) {
         $this->addContentParameter($parameter);
     }
     if ($object->to && count($object->to->emailRecipients) > 1) {
         $this->addError("Multiple recipients is not supported in admin console, saving the configuration will remove the existing recipients list.");
     }
     if ($object->to && count($object->to->emailRecipients)) {
         $to = reset($object->to->emailRecipients);
         /* @var $to KalturaEmailNotificationRecipient */
         $this->setDefault('to_email', $to->email->value);
         $this->setDefault('to_name', $to->name->value);
     }
 }
 public function populateFromObject($object, $add_underscore = true)
 {
     parent::populateFromObject($object, $add_underscore);
     if (!$object instanceof Kaltura_Client_HttpNotification_Type_HttpNotificationTemplate) {
         return;
     }
     if (!$object->data) {
         return;
     }
     if ($object->data instanceof Kaltura_Client_HttpNotification_Type_HttpNotificationDataFields) {
         $this->getElement('dataType')->setValue('map');
     } elseif ($object->data instanceof Kaltura_Client_HttpNotification_Type_HttpNotificationDataText) {
         $this->getElement('dataType')->setValue('text');
         $this->getElement('freeText')->setValue($object->data->content->value);
     } elseif ($object->data instanceof Kaltura_Client_HttpNotification_Type_HttpNotificationObjectData) {
         $this->getElement('dataType')->setValue('object');
         $this->getElement('objectType')->setValue($object->data->apiObjectType);
         $this->getElement('objectFormat')->setValue($object->data->format);
         $this->getElement('object')->setValue($object->data->code);
     }
 }