note 87738 deleted from language.constants.predefined by danbrown
| From: | danbrown@php.net | Date: | Thu, 18 Dec 2008 20:44:53 +0000 |
| Subject: | note 87738 deleted from language.constants.predefined by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-148332@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
In response to jamescol:
We don't really require another constant. Instead use the function
get_called_class();
So your model would look like this:
class Model
{
public static function find()
{
echo get_called_class();
}
}
class User extends Model
{
}
User::find(); # User