Exemplo n.º 1
0
 public function unmapValue(Reflection\Property $property, $value)
 {
     if ($value === null) {
         return "";
     } elseif ($value instanceof \DateTime && isset(self::$format[$property->getType()])) {
         $value = $value->format(self::$format[$property->getType()]);
         if ($value === false) {
             throw new \Exception("Can not convert DateTime automatically!");
         }
     }
     return $value;
 }
Exemplo n.º 2
0
 public function unmapValue(Reflection\Property $property, $value)
 {
     if ($property->getType() === Reflection\Property::TYPE_DATE) {
         return new Date($value);
     }
     return $value;
 }