note 87739 added to language.constants.predefined
| From: | jpfuentes2 at gmail dot com | Date: | Thu, 18 Dec 2008 20:44:55 +0000 |
| Subject: | note 87739 added to language.constants.predefined | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-148333@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 php5.3 introduces:
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/87739
Del: integrated -- https://master.php.net/note/delete/87739/integrated
Del: useless -- https://master.php.net/note/delete/87739/useless
Del: bad code -- https://master.php.net/note/delete/87739/bad+code
Del: spam -- https://master.php.net/note/delete/87739/spam
Del: non-english -- https://master.php.net/note/delete/87739/non-english
Del: in docs -- https://master.php.net/note/delete/87739/in+docs
Del: other reasons-- https://master.php.net/note/delete/87739
Reject -- https://master.php.net/note/reject/87739
Search -- https://master.php.net/manage/user-notes.php