/**
  * @return string
  */
 protected function renderAttributeIndexOrDerivedType()
 {
     $hiddenInputName = Element::resolveInputNamePrefixIntoString(array_merge($this->inputPrefixData, array('attributeIndexOrDerivedType')));
     $hiddenInputId = Element::resolveInputIdPrefixIntoString(array_merge($this->inputPrefixData, array('attributeIndexOrDerivedType')));
     $idInputHtmlOptions = array('id' => $hiddenInputId);
     return ZurmoHtml::hiddenField($hiddenInputName, $this->model->getAttributeIndexOrDerivedType(), $idInputHtmlOptions);
 }
예제 #2
0
 /**
  * Override to handle use case of $name == 'id'.
  * As this form does not have an 'id', it will return null;
  * @see ModelElement.  This form is used by ModelElement for example
  * and ModelElement expects the model to have an 'id' value.
  */
 public function __get($name)
 {
     if ($name == 'id') {
         return null;
     }
     return parent::__get($name);
 }
 /**
  * Special override to handle setting attributeIndexOrDerivedType
  * @param string $name
  * @param mixed $value
  * @return mixed|void
  */
 public function __set($name, $value)
 {
     if ($name == 'attributeIndexOrDerivedType') {
         $this->_attributeIndexOrDerivedType = $value;
         $this->resolveAttributeOrRelationAndAttributeDataByIndexType($value);
     } else {
         parent::__set($name, $value);
     }
 }
 /**
  * Override to properly handle retrieving rule information from the model for the attribute name.
  */
 public function rules()
 {
     return array_merge(parent::rules(), array(array('type', 'type', 'type' => 'string'), array('type', 'required'), array('audienceType', 'safe'), array('audienceType', 'required')));
 }
 /**
  * @return bool
  */
 public function beforeValidate()
 {
     if (!$this->validateAttributes()) {
         return false;
     }
     return parent::beforeValidate();
 }
 /**
  * @return bool
  */
 public function beforeValidate()
 {
     if (!$this->validateRecipients()) {
         return false;
     }
     return parent::beforeValidate();
 }
예제 #7
0
 public function rules()
 {
     return array_merge(parent::rules(), array(array('type', 'type', 'type' => 'string'), array('firstSeries', 'type', 'type' => 'string'), array('firstRange', 'type', 'type' => 'string'), array('secondSeries', 'type', 'type' => 'string'), array('secondRange', 'type', 'type' => 'string'), array('type', 'validateSeriesAndRange')));
 }
 /**
  * Override to properly handle retrieving rule information from the model for the attribute name.
  */
 public function rules()
 {
     $rules = array_merge(parent::rules(), array(array('type', 'type', 'type' => 'string'), array('type', 'required'), array('value', 'safe'), array('value', 'validateValue'), array('shouldSetValue', 'boolean')));
     $applicableRules = ModelAttributeRulesToWorkflowActionAttributeUtil::getApplicableRulesByModelClassNameAndAttributeName($this->modelClassName, $this->modelAttributeName, 'value');
     return array_merge($rules, $applicableRules);
 }