Skip to content

Instantly share code, notes, and snippets.

@howyi
Created January 15, 2020 16:44
Show Gist options
  • Save howyi/bec46ed8d21689d5b3edac95f9d7f45c to your computer and use it in GitHub Desktop.
Save howyi/bec46ed8d21689d5b3edac95f9d7f45c to your computer and use it in GitHub Desktop.
<?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