コード例 #1
0
ファイル: DateType.php プロジェクト: doctrine/oxm
 public function convertToPHPValue($value)
 {
     if ($value === null) {
         return null;
     }
     $val = \DateTime::createFromFormat('!' . static::FORMAT, $value);
     if (!$val) {
         throw ConversionException::conversionFailed($value, $this->getName());
     }
     return $val;
 }
コード例 #2
0
ファイル: ObjectType.php プロジェクト: krishcdbry/z-zangura
 public function convertToPHPValue($value, \Doctrine\DBAL\Platforms\AbstractPlatform $platform)
 {
     if ($value === null) {
         return null;
     }
     $value = is_resource($value) ? stream_get_contents($value) : $value;
     $val = unserialize($value);
     if ($val === false && $value !== 'b:0;') {
         throw ConversionException::conversionFailed($value, $this->getName());
     }
     return $val;
 }