예제 #1
0
 protected function normalizeObject($val, $bEmpty = false)
 {
     if ($val instanceof common\_object && !$val instanceof common\argumentable) {
         \Sylma::throwException(sprintf('Cannot normalize object instance of %s', $val->getInterface()->getName()));
     } else {
         if ($val instanceof common\argumentable) {
             if ($arg = $val->asArgument()) {
                 $mResult = $arg;
                 //$this->normalizeArgument($arg);
             } else {
                 $mResult = null;
             }
         } else {
             if ($val instanceof common\stringable) {
                 if ($sValue = $val->asString()) {
                     $mResult = $this->normalizeArgument($this->getWindow()->argToInstance($sValue)->asArgument());
                 }
             } else {
                 if ($val instanceof common\arrayable) {
                     $mResult = $this->getWindow()->toString($val->asArray());
                 } else {
                     $mResult = parent::normalizeObject($val, $bEmpty);
                 }
             }
         }
     }
     return $mResult;
 }
예제 #2
0
 public function &parseValue(array &$aPath, &$mValue, $bDebug)
 {
     if ($mResult = $this->checkClosure($mValue)) {
         prev($aPath);
     } else {
         $mResult =& parent::parseValue($aPath, $mValue, $bDebug);
     }
     return $mResult;
 }
예제 #3
0
 public function add($mValue, $bRef = false)
 {
     $sResult = null;
     list($sKey, $sValue) = $mValue;
     if (!in_array($sKey, $this->aKeys)) {
         $this->aKeys[] = $sKey;
         $sResult = parent::add($sValue, $bRef);
     }
     return $sResult;
 }
예제 #4
0
 public function add($mValue, $bRef = false)
 {
     if (is_array($mValue)) {
         foreach ($mValue as $mItem) {
             parent::add($mItem);
         }
     } else {
         parent::add($mValue);
     }
 }
예제 #5
0
 public function read($sPath = '', $bDebug = true, $bHTML = false)
 {
     $sResult = parent::read($sPath, $bDebug);
     return $bHTML ? $sResult : htmlspecialchars($sResult);
 }
예제 #6
0
 public function add($mValue, $bRef = false)
 {
     list($sKey, $sValue) = $mValue;
     return parent::add($sValue, $bRef);
 }