Skip to content

Instantly share code, notes, and snippets.

@dhotson
Created March 13, 2013 23:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhotson/5157651 to your computer and use it in GitHub Desktop.
Save dhotson/5157651 to your computer and use it in GitHub Desktop.
diff --git a/lib/Pheasant/DomainObject.php b/lib/Pheasant/DomainObject.php
index 41a103c..be04890 100755
--- a/lib/Pheasant/DomainObject.php
+++ b/lib/Pheasant/DomainObject.php
@@ -65,9 +65,9 @@ class DomainObject
* Used by the default initialize() method, returns the table name to use
* @return string
*/
- public function tableName()
+ public static function tableName()
{
- $tokens = explode('\\', get_class($this));
+ $tokens = explode('\\', get_called_class());
return strtolower(array_pop($tokens));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment