|
Posted by Andrι Pletschette on 03/15/05 13:34
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!");
}
}
Navigation:
[Reply to this message]
|