コード例 #1
0
 /**
  * Process all attributes except 'emailMessageRecipients' first
  * @param $values
  * @param bool $safeOnly
  * @throws NotSupportedException if the post values data is malformed
  */
 public function setAttributes($values, $safeOnly = true)
 {
     $recipients = null;
     if (isset($values[self::EMAIL_MESSAGE_RECIPIENTS]) && is_array($values[self::EMAIL_MESSAGE_RECIPIENTS])) {
         $recipients = $values[self::EMAIL_MESSAGE_RECIPIENTS];
         unset($values[self::EMAIL_MESSAGE_RECIPIENTS]);
         $this->_emailMessageRecipients = array();
     }
     parent::setAttributes($values, $safeOnly);
     if ($recipients != null) {
         $count = 0;
         foreach ($recipients as $temporaryKey => $recipientData) {
             if (!isset($recipientData['type'])) {
                 throw new NotSupportedException();
             }
             $form = WorkflowEmailMessageRecipientFormFactory::make($recipientData['type'], $this->_modelClassName, $this->_workflowType);
             $form->setAttributes($recipientData);
             $this->_emailMessageRecipients[] = $form;
             $this->_emailMessageRecipientsRealToTemporaryKeyData[] = $temporaryKey;
             $count++;
         }
     }
 }
コード例 #2
0
 /**
  * Process all attributes except 'attributes' first since the 'attributes' requires the 'type' to be set
  * @param $values
  * @param bool $safeOnly
  */
 public function setAttributes($values, $safeOnly = true)
 {
     $valuesAttributes = null;
     if (isset($values[self::ACTION_ATTRIBUTES])) {
         $valuesAttributes = $values[self::ACTION_ATTRIBUTES];
         unset($values[self::ACTION_ATTRIBUTES]);
         $this->_actionAttributes = array();
     }
     parent::setAttributes($values, $safeOnly);
     if ($valuesAttributes != null) {
         $this->resolveSettingAttributesForSubscribeToListType($valuesAttributes);
     }
 }
コード例 #3
0
 /**
  * Process all attributes except 'attributes' first since the 'attributes' requires the 'type' to be set
  * @param $values
  * @param bool $safeOnly
  */
 public function setAttributes($values, $safeOnly = true)
 {
     $valuesAttributes = null;
     if (isset($values[self::ACTION_ATTRIBUTES])) {
         $valuesAttributes = $values[self::ACTION_ATTRIBUTES];
         unset($values[self::ACTION_ATTRIBUTES]);
         $this->_actionAttributes = array();
     }
     parent::setAttributes($values, $safeOnly);
     if ($valuesAttributes != null) {
         foreach ($valuesAttributes as $attribute => $attributeData) {
             $resolvedAttributeName = static::resolveRealAttributeName($attribute);
             $resolvedModelClassName = static::resolveRealModelClassName($attribute, $this->_modelClassName, $this->type, $this->relation, $this->relatedModelRelation);
             $form = WorkflowActionAttributeFormFactory::make($resolvedModelClassName, $resolvedAttributeName);
             $form->setAttributes($attributeData);
             if ($form->shouldSetValue) {
                 $this->_actionAttributes[$attribute] = $form;
             }
         }
     }
 }