/** * {@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(); }
/** * {@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(); }
/** * {@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; }
/** * {@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; }
/** * {@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; }
/** * {@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(); }
/** * {@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; }
/** * {@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_'); }