Is their something like $classname::$tablename ?
| From: | André Pletschette | Date: | Tue, 15 Mar 2005 11:34:43 +0000 |
| Subject: | Is their something like $classname::$tablename ? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-210756@lists.php.net to get a copy of this message | ||
Hi,
I've got one function getTableName() which returns the Database-Table with the data of a class (see below).
As you can see it always calls the static $tablename of the subclass described by $this->classname.
Thankyou,
André
Here the function:
function getTableName() {
if ($this->classname == "class1") {
return class1::$tablename;
} elseif ($this->classname == "class2") {
return class2::$tablename;
} elseif ($this->classname == "class3") {
return class3::$tablename;
}...
...
}else {
throw new Exception($this->classname." not found!");
} }