/** * @param string|DateTime $value * @return self */ public function setDefaultValue($value = NULL) { if ($value instanceof DateTime) { $value = $value->format($this->format); } return parent::setDefaultValue($value); }
/** * @param array $value * @return TagInput provides fluent interface */ public function setDefaultValue($value) { if (!is_array($value)) { throw new \Nette\InvalidArgumentException("Invalid argument type passed to " . __METHOD__ . ", expected array."); } parent::setDefaultValue(implode($this->joiner, $value)); return $this; }
/** * @inheritdoc */ public function setDefaultValue($value) { if (!$value instanceof \DateTime) { $type = gettype($value); throw new InvalidArgumentException(sprintf("As default value, %s object must be given, '%s' given instead.", \DateTime::class, $type === 'object' ? get_class($value) : $type)); } return parent::setDefaultValue($value); }
/** * @inheritdoc */ public function setDefaultValue($value) { if (!$value instanceof \DateTime) { $type = gettype($value); throw new InvalidArgumentException("As default value, \\DateTime object must be given. '" . ($type === 'object' ? get_class($value) : $type) . "' given instead"); } return parent::setDefaultValue($value); }