note 86681 added to language.constants.predefined
| From: | -no dot spam-fraseatcsdotwiscdotedu at osu1 dot php dot net | Date: | Wed, 29 Oct 2008 17:27:16 +0000 |
| Subject: | note 86681 added to language.constants.predefined | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-145938@lists.php.net to get a copy of this message | ||
me at jamessocol dot com:
couldn't you use get_called_class() for that? i.e.
<?php
class Model
{
public static function find()
{
echo get_called_class();
}
}
class Product extends Model {}
class User extends Model {}
Product::find(); // "Product"
User::find(); // "User"
?>
----
Server IP: 209.41.74.194
Probable Submitter: 72.55.202.68
----
Manual Page -- http://www.php.net/manual/en/language.constants.predefined.php
Edit -- https://master.php.net/note/edit/86681
Del: integrated -- https://master.php.net/note/delete/86681/integrated
Del: useless -- https://master.php.net/note/delete/86681/useless
Del: bad code -- https://master.php.net/note/delete/86681/bad+code
Del: spam -- https://master.php.net/note/delete/86681/spam
Del: non-english -- https://master.php.net/note/delete/86681/non-english
Del: in docs -- https://master.php.net/note/delete/86681/in+docs
Del: other reasons-- https://master.php.net/note/delete/86681
Reject -- https://master.php.net/note/reject/86681
Search -- https://master.php.net/manage/user-notes.php