protected function dataTransform(&$value)
    {
        if (is_object($value)) {

            // Convert dates to the settings for date_format.
            if (($dateFormat = $this->getSettings()->dateFormat) && $value instanceof \DateTime) {
                $value = $value->format($dateFormat);
            }

            // Handle other objects as needed.
            if (method_exists($this, 'objectHandler')) {
                $value = $this->objectHandler($key, $value);
            }
        }
    }