protected function castObject($value)
    {
        if ($value instanceof \DateTime) {
            return $value->format('c');
        }
        
        if (method_exists($value, '__toString')) {
            return (string)$value;
        }
        
        return $this->dontCast($value);
    }
protected function castObject($value)
    {
        if ($value instanceof \DateTime) {
            return $value->format('c');
        }
        
        if (method_exists($value, '__toString')) {
            return (string)$value;
        }
        
        return $this->dontCast($value);
    }
protected function castObject ( $ value ) { if ( $ value instanceof \ DateTime ) { return $ value -> format ( 'c' ) ; } if ( method_exists ( $ value , '__toString' ) ) { return ( string ) $ value ; } return $ this -> dontCast ( $ value ) ; }
Cast an object to a string

@param mixed $value
@return object
Cast an object to a string