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; }
public function unmapValue(Reflection\Property $property, $value) { if ($property->getType() === Reflection\Property::TYPE_DATE) { return new Date($value); } return $value; }