Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function validate()
 {
     if (!$this->isSubmit()) {
         return false;
     }
     $this->buildWidgets();
     $this->validateWidgets();
     $this->updateErrorCollection();
     foreach ($this->getForms() as $form) {
         foreach ($form->getFields() as $field) {
             $this->context->setParam(substr($field->getName(), strlen($form->getName()) + 1), $this->propertyValues->getPropertyValue($field->getName()), $form->getName());
         }
     }
     return $this->propertyValues->hasNoInvalidPropertyValues();
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function match(ModelInterface $model = null, PropertyValueBag $input = null, PropertyInterface $property = null, LegendInterface $legend = null)
 {
     if ($input && $input->hasPropertyValue('attr_id')) {
         $value = $input->getPropertyValue('attr_id');
     } elseif ($model) {
         $value = $model->getProperty('attr_id');
     } else {
         return false;
     }
     return $this->getTypeOfAttribute($value) == $this->getAttributeType();
 }
Exemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function match(ModelInterface $model = null, PropertyValueBag $input = null, PropertyInterface $property = null, LegendInterface $legend = null)
 {
     if ($input && $input->hasPropertyValue($this->propertyName)) {
         $value = $input->getPropertyValue($this->propertyName);
     } elseif ($model) {
         $value = $model->getProperty($this->propertyName);
     } else {
         return false;
     }
     return $this->strict ? $value === $this->propertyValue : $value == $this->propertyValue;
 }
Exemplo n.º 4
0
 /**
  * {@inheritdoc}
  */
 public function getMatchCount(ModelInterface $model = null, PropertyValueBag $input = null)
 {
     if (!$this->propertyName) {
         return false;
     }
     if ($input && $input->hasPropertyValue($this->propertyName)) {
         $value = $input->getPropertyValue($this->propertyName);
     } elseif ($model) {
         $value = $model->getProperty($this->propertyName);
     } else {
         return false;
     }
     return $this->strict ? $value === false : !$value ? $this->getWeight() : false;
 }
Exemplo n.º 5
0
 /**
  * {@inheritdoc}
  */
 public function getMatchCount(ModelInterface $model = null, PropertyValueBag $input = null)
 {
     if ($input && $input->hasPropertyValue('attr_id')) {
         $value = $input->getPropertyValue('attr_id');
     } elseif ($model) {
         $value = $model->getProperty('attr_id');
     } else {
         return false;
     }
     return $this->getTypeOfAttribute($value) == $this->getAttributeType() ? $this->getWeight() : false;
 }
Exemplo n.º 6
0
 /**
  * {@inheritdoc}
  */
 public function match(ModelInterface $model = null, PropertyValueBag $input = null, PropertyInterface $property = null, LegendInterface $legend = null)
 {
     if ($input && $input->hasPropertyValue('pid')) {
         $value = $input->getPropertyValue('pid');
     } elseif ($model) {
         $value = $model->getProperty('pid');
     } else {
         return false;
     }
     return $this->getInputScreenRenderMode($value) == $this->getRenderMode();
 }
Exemplo n.º 7
0
 /**
  * {@inheritdoc}
  */
 public function match(ModelInterface $model = null, PropertyValueBag $input = null, PropertyInterface $property = null, LegendInterface $legend = null)
 {
     if ($input && $input->hasPropertyValue($this->propertyName)) {
         $values = $input->getPropertyValue($this->propertyName);
     } elseif ($model) {
         $values = $model->getProperty($this->propertyName);
     } else {
         return false;
     }
     if (!$values || !is_array($values)) {
         return false;
     }
     foreach ($values as $value) {
         if (in_array($value, $this->propertyValue, $this->strict)) {
             return true;
         }
     }
     return false;
 }
Exemplo n.º 8
0
 /**
  * {@inheritdoc}
  */
 public function match(ModelInterface $model = null, PropertyValueBag $input = null, PropertyInterface $property = null, LegendInterface $legend = null)
 {
     $propertyName = $this->getTablePropertyName();
     if ($input && $input->hasPropertyValue($propertyName)) {
         $value = $input->getPropertyValue($propertyName);
     } elseif ($model) {
         $value = $model->getProperty($propertyName);
     } else {
         return false;
     }
     return $this->desiredValue == (substr($value, 0, 3) === 'mm_');
 }