Created
December 20, 2016 18:24
-
-
Save kinncj/5b7596594ed9e5cab68987183582ae4d to your computer and use it in GitHub Desktop.
questão do joubertredrat no PHPSP - Slack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
SuaPlatform extends MySQLWHateverPlatform | |
{ | |
/** .. **/ | |
public function getDefaultValueDeclarationSQL($field) | |
{ | |
$default = parent::getDefaultValueDeclarationSQL($field); | |
$this->decorateDatetime($field, $default); | |
return $default; | |
} | |
private function isDatetime($field, &$default) | |
{ | |
if (isset($field['type']) && in_array((string) $field['type'], array('DateTime', 'DateTimeTz'))) { | |
$default = " DEFAULT " . $field['default']; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment