eZ\Publish\Core\FieldType\Date\Type::fromHash PHP Method

fromHash() public method

Converts an $hash to the Value defined by the field type.
public fromHash ( mixed $hash ) : Value
$hash mixed Null or associative array containing timestamp and optionally date in RFC850 format.
return Value $value
    public function fromHash($hash)
    {
        if ($hash === null) {
            return $this->getEmptyValue();
        }
        if (isset($hash['rfc850']) && $hash['rfc850']) {
            return Value::fromString($hash['rfc850']);
        }
        return Value::fromTimestamp((int) $hash['timestamp']);
    }