예제 #1
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;
 }
예제 #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();
 }
예제 #3
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;
 }
예제 #4
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;
 }
예제 #5
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();
 }
예제 #6
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;
 }
예제 #7
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_');
 }