Пример #1
0
 public function importValue($value)
 {
     if ($value instanceof HttpUrl) {
         return $this->import([$this->getName() => $value->toString()]);
     } elseif (is_scalar($value)) {
         return parent::importValue($value);
     }
     return parent::importValue(null);
 }
Пример #2
0
 public function import($scope)
 {
     if (!($result = parent::import($scope))) {
         return $result;
     }
     if (!ClassUtils::isClassName($scope[$this->name]) || !$this->classExists($scope[$this->name]) || $this->ofClassName && !ClassUtils::isInstanceOf($scope[$this->name], $this->ofClassName)) {
         $this->value = null;
         return false;
     }
     return true;
 }
Пример #3
0
 public function import($scope)
 {
     if (!($result = parent::import($scope))) {
         return $result;
     }
     if ($this->value = $this->isSplitByRegexp() ? preg_split($this->separator, $this->value, -1, PREG_SPLIT_NO_EMPTY) : explode($this->separator, $this->value)) {
         return true;
     } else {
         return false;
     }
 }