type = MetadataFieldType::DATE; } /** * Sets the default date for this field. * * @param DateTime $defaultValue The date to set. */ public function setDefaultValue($defaultValue) { $this->defaultValue = Utils::toISO8601DateOnly($defaultValue); } /** * Gets the default date of this field. * * @return DateTime|null * @throws Exception When the underlying value is malformed. */ public function getDefaultValue() { return $this->defaultValue ? new DateTime($this->defaultValue) : null; } }