Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function equals(CharacteristicInterface $characteristic)
 {
     return $characteristic instanceof TextCharacteristic && $characteristic->getText() === $this->getText();
 }
Ejemplo n.º 2
0
 /**
  * {@inheritDoc}
  */
 public function buildCharacteristicValue(CharacteristicInterface $characteristic, Definition $definition)
 {
     // TODO
     return (string) $characteristic->display($definition);
 }
Ejemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function equals(CharacteristicInterface $characteristic)
 {
     return $characteristic instanceof NumberCharacteristic && $characteristic->getNumber() === $this->number;
 }
 /**
  * {@inheritdoc}
  */
 public function equals(CharacteristicInterface $characteristic)
 {
     return $characteristic instanceof BooleanCharacteristic && $characteristic->getBoolean() === $this->getBoolean();
 }
 /**
  * Returns whether the characteristic is null or equals parent's or not.
  *
  * @param \Ekyna\Component\Characteristics\Model\CharacteristicInterface $characteristic
  * @return bool
  */
 private function isNullOrEqualsParentData(CharacteristicInterface $characteristic)
 {
     if ($characteristic->isNull()) {
         return true;
     } elseif (null !== $this->parentDatas && null !== ($parentCharacteristic = $this->parentDatas->findCharacteristicByIdentifier($characteristic->getIdentifier()))) {
         return $parentCharacteristic->equals($characteristic);
     }
     return false;
 }
 /**
  * {@inheritdoc}
  */
 public function equals(CharacteristicInterface $characteristic)
 {
     return $characteristic instanceof DatetimeCharacteristic && $characteristic->getDatetime() === $this->getDatetime();
 }