note 89310 added to language.oop5.visibility
| From: | sverel at osu1 dot php dot net | Date: | Tue, 03 Mar 2009 11:31:56 +0000 |
| Subject: | note 89310 added to language.oop5.visibility | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-151377@lists.php.net to get a copy of this message | ||
How can i get static var of child class from parent class.
For example i need:
abstract class API_MODEL {
protected static $_TABLE;
function getById($ID)
{
$tbl = self::$_TABLE;
var_dump($tbl);
}
}
class MODEL_NEWS extends API_MODEL {
protected static $_TABLE = 'news';
}
MODEL_NEWS::getById(23); // var $tbl is NULL.
----
Server IP: 78.41.104.32
Probable Submitter: 81.88.210.160
----
Manual Page -- http://www.php.net/manual/en/language.oop5.visibility.php
Edit -- https://master.php.net/note/edit/89310
Del: integrated -- https://master.php.net/note/delete/89310/integrated
Del: useless -- https://master.php.net/note/delete/89310/useless
Del: bad code -- https://master.php.net/note/delete/89310/bad+code
Del: spam -- https://master.php.net/note/delete/89310/spam
Del: non-english -- https://master.php.net/note/delete/89310/non-english
Del: in docs -- https://master.php.net/note/delete/89310/in+docs
Del: other reasons-- https://master.php.net/note/delete/89310
Reject -- https://master.php.net/note/reject/89310
Search -- https://master.php.net/manage/user-notes.php