Пример #1
0
 protected function getValueFromExpression(\blaze\web\application\BlazeContext $context, $subExpressions, $subBrackets, $expr)
 {
     if ($expr instanceof BaseOperation) {
         $val = $expr->getValue($context, $subExpressions, $subBrackets);
     } else {
         $val = $expr;
     }
     $val = $this->resolveSubParts($context, $subExpressions, $subBrackets, $val);
     if (($class = \blaze\lang\Number::getNumberClass($val)) != null) {
         return $class->getMethod('asNative')->invoke(null, $val);
     } else {
         if (preg_match('/^(true|false)$/', $val)) {
             return \blaze\lang\Boolean::parseBoolean($val);
         } else {
             if (preg_match('/^(null)$/', $val)) {
                 return null;
             } else {
                 //if(strpos($val, '.') !== false)
                 return $context->getELContext()->getELResolver()->getValue($val);
                 //            else
                 //                return $val;
             }
         }
     }
 }
Пример #2
0
 public function getImmediate()
 {
     if ($this->immediate == null) {
         return false;
     }
     $imm = $this->getResolvedExpression($this->immediate);
     return \blaze\lang\Boolean::isType($imm) ? $imm : \blaze\lang\String::asWrapper($imm)->trim()->compareToIgnoreCase('true') == 0;
 }
 public function setBoolean($identifier, $value)
 {
     $this->set($identifier, \blaze\lang\Boolean::asNative($value), \PDO::PARAM_BOOL);
     return $this;
 }
Пример #4
0
 public function getDisabled()
 {
     if ($this->disabled === null) {
         return false;
     }
     $disabled = $this->getResolvedExpression($this->disabled);
     return \blaze\lang\Boolean::isType($disabled) ? $disabled : \blaze\lang\String::asWrapper($disabled)->trim()->compareToIgnoreCase('true') == 0;
 }
Пример #5
0
 public function readBoolean()
 {
     $result = unserialize($this->getNext());
     if (!\blaze\lang\Boolean::isType($result)) {
         throw new \blaze\lang\ClassCastException('The next token is not a boolean');
     }
     return $result;
 }
Пример #6
0
 public function writeBoolean(\boolean $boolean)
 {
     $boolean = \blaze\lang\Boolean::asNative($boolean);
     return $this->out->write(serialize($boolean));
 }