/** * {@inheritdoc} */ public function sanitize() { if ($this->canSanitize()) { return new \DateTime($this->getInput()); } return parent::sanitize(); }
/** * {@inheritdoc} */ public function sanitize() { if ($this->isValid()) { return $this->getInput(); } elseif ($this->canSanitize()) { return $this->default; } else { return parent::sanitize(); } }