Exemplo n.º 1
0
 /**
  * Method that maps return the value to be applied to the current property. The name passed may be the property
  * name or the expected/bindTo name of the property. If exists runs the handler callback of the property.
  *
  * @param $name
  * @param $val
  * @param $scenario
  * @return mixed|Value
  */
 private function map($name, $val, $scenario)
 {
     $callback = null;
     if ($this->mapCallback !== null) {
         $callback = self::runMapCallback($this->mapCallback, $val, $name, $scenario);
     }
     return $callback === null ? $this->adapter->map($val, $this, $name, $scenario) : new Value(true, $callback);
 }
 public static function create($c)
 {
     $c = ucfirst(strtolower($c));
     if (!TypeAdapter::isValid($c)) {
         throw new Exception("Database type support for ({$c}) not yet available", 1);
     }
     $method = __NAMESPACE__ . "\\" . "TypeAdapter" . $c;
     return new $method();
 }