public function transform($value)
    {
        if (null === $value) {
            return '';
        }
        if (!$value instanceof \DateInterval) {
            throw new UnexpectedTypeException($value, '\DateInterval');
        }

        return $value->format($this->format);
    }
public function transform($value)
    {
        if (null === $value) {
            return '';
        }
        if (!$value instanceof \DateInterval) {
            throw new UnexpectedTypeException($value, '\DateInterval');
        }

        return $value->format($this->format);
    }
public function transform ( $ value ) { if ( null === $ value ) { return '' ; } if ( ! $ value instanceof \ DateInterval ) { throw new UnexpectedTypeException ( $ value , '\DateInterval' ) ; } return $ value -> format ( $ this -> format ) ; }
Transforms a DateInterval object into a date string with the configured format.

@param \DateInterval $value A DateInterval object

@return string An ISO 8601 or relative date string like date interval presentation

@throws UnexpectedTypeException if the given value is not a \DateInterval instance
Transforms a DateInterval object into a date string with the configured format .