note 87738 added to language.constants.predefined
| From: | Anonymous at osu1 dot php dot net | Date: | Thu, 18 Dec 2008 20:43:45 +0000 |
| Subject: | note 87738 added to language.constants.predefined | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-148331@lists.php.net to get a copy of this message | ||
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
----
Server IP: 208.69.120.35
Probable Submitter: 12.96.208.195
----
Manual Page -- http://www.php.net/manual/en/language.constants.predefined.php
Edit -- https://master.php.net/note/edit/87738
Del: integrated -- https://master.php.net/note/delete/87738/integrated
Del: useless -- https://master.php.net/note/delete/87738/useless
Del: bad code -- https://master.php.net/note/delete/87738/bad+code
Del: spam -- https://master.php.net/note/delete/87738/spam
Del: non-english -- https://master.php.net/note/delete/87738/non-english
Del: in docs -- https://master.php.net/note/delete/87738/in+docs
Del: other reasons-- https://master.php.net/note/delete/87738
Reject -- https://master.php.net/note/reject/87738
Search -- https://master.php.net/manage/user-notes.php