コード例 #1
0
 /**
  * Fill Channel from array.
  *
  * @param array $options Array containing values for object properties
  */
 public function fromArray($options)
 {
     if (isset($options['Id'])) {
         Validate::isString($options['Id'], 'options[Id]');
         $this->_id = $options['Id'];
     }
     if (isset($options['Name'])) {
         Validate::isString($options['Name'], 'options[Name]');
         $this->_name = $options['Name'];
     }
     if (isset($options['Created'])) {
         Validate::isDateString($options['Created'], 'options[Created]');
         $this->_created = new \DateTime($options['Created']);
     }
     if (isset($options['Description'])) {
         Validate::isString($options['Description'], 'options[Description]');
         $this->_description = $options['Description'];
     }
     if (isset($options['LastModified'])) {
         Validate::isDateString($options['LastModified'], 'options[LastModified]');
         $this->_lastModified = new \DateTime($options['LastModified']);
     }
     if (isset($options['State'])) {
         Validate::isString($options['State'], 'options[State]');
         $this->_state = $options['State'];
     }
     if (!empty($options['Input'])) {
         Validate::isArray($options['Input'], 'options[Input]');
         $this->_input = ChannelInput::createFromOptions($options['Input']);
     }
     if (!empty($options['Output'])) {
         Validate::isArray($options['Output'], 'options[Output]');
         $this->_output = ChannelOutput::createFromOptions($options['Output']);
     }
     if (!empty($options['Preview'])) {
         Validate::isArray($options['Preview'], 'options[Preview]');
         $this->_preview = ChannelPreview::createFromOptions($options['Preview']);
     }
     if (!empty($options['CrossSiteAccessPolicies'])) {
         Validate::isArray($options['CrossSiteAccessPolicies'], 'options[CrossSiteAccessPolicies]');
         $this->_crossSiteAccessPolicies = CrossSiteAccessPolicies::createFromOptions($options['CrossSiteAccessPolicies']);
     }
     if (isset($options['EncodingType'])) {
         Validate::isString($options['EncodingType'], 'options[EncodingType]');
         $this->_encodingType = $options['EncodingType'];
     }
     if (!empty($options['Encoding'])) {
         Validate::isArray($options['Encoding'], 'options[Encoding]');
         $this->_encoding = ChannelEncoding::createFromOptions($options['Encoding']);
     }
     if (!empty($options['Slate'])) {
         Validate::isArray($options['Slate'], 'options[Slate]');
         $this->_slate = ChannelSlate::createFromOptions($options['Slate']);
     }
 }