Created
January 15, 2020 16:44
-
-
Save howyi/bec46ed8d21689d5b3edac95f9d7f45c to your computer and use it in GitHub Desktop.
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 | |
/** | |
* @return string | |
*/ | |
public function getDefault(): string | |
{ | |
if (is_numeric($this->default)) { | |
return $this->default; | |
} elseif (strtoupper($this->type) === 'TIMESTAMP' and $this->default = 'CURRENT_TIMESTAMP') { | |
return $this->default; | |
} else { | |
return "'$this->default'"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment