/** * {@inheritdoc} */ protected function prepareDefault() { $defaultValue = parent::prepareDefault(); if ($this->abstractType() == 'boolean') { $defaultValue = (int) $this->defaultValue; } return $defaultValue; }
/** * {@inheritdoc} */ protected function prepareDefault() { if ($this->abstractType() == 'timestamp' && is_scalar($this->defaultValue)) { if (is_numeric($this->defaultValue)) { //Nothing to do return (int) $this->defaultValue; } $datetime = new \DateTime($this->defaultValue, new \DateTimeZone(DatabaseManager::DEFAULT_TIMEZONE)); return $datetime->getTimestamp(); } return parent::prepareDefault(); }