Doctrine\OXM\Types\DateType::convertToPHPValue PHP Метод

convertToPHPValue() публичный Метод

public convertToPHPValue ( $value )
    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;
    }

Usage Example

Пример #1
0
 public function testNullConversion()
 {
     $this->assertNull($this->_type->convertToPHPValue(null));
 }