Ejemplo n.º 1
0
 /**
  * Test Value against Condition
  *
  * @param Value $value
  * @return bool
  * @throws \PayBreak\Foundation\Decision\ProcessingException
  */
 public function checkCondition(Value $value)
 {
     if ($value->getType() == Value::VALUE_NON_EXISTS) {
         return true;
     }
     return false;
 }
Ejemplo n.º 2
0
 /**
  * Test Value against Condition
  *
  * @author WN
  * @param Value $value
  * @return bool
  * @throws ProcessingException
  */
 public function checkCondition(Value $value)
 {
     if ($this->getValue() instanceof Value) {
         if ($value->getType() != Value::VALUE_DEFAULT) {
             throw new ProcessingException('Value is not default type');
         }
         if ($value->getValue() == $this->getValue()->getValue()) {
             return true;
         }
         return false;
     }
     throw new ProcessingException('Internal value not set. Could not perform any checks.');
 }
Ejemplo n.º 3
0
 /**
  * @param \PayBreak\Foundation\Data\Value $value
  * @return bool
  * @throws ProcessingException
  */
 protected function compareType(Value $value)
 {
     if (!($value->getType() & Value::VALUE_EXPECTED)) {
         return false;
     }
     if ($this->getValue() instanceof Value) {
         if ($this->getValue()->getType() === $value->getType()) {
             return true;
         }
         throw new ProcessingException('Values types are different. Unable to compare.');
     }
     throw new ProcessingException('Internal value not set. Could not perform any checks.');
 }