Possible Duplicate:
how do i access static member of a class?
I have this class. In its createNew
function I refer to $reftbArr = tc_group::$tblFields;
.
I have many classes similar to this class a couple of times. They have the same methods and variables but of course the class name is different.
How is the best way in the function createNew
to access tc_group::$tblFields;
but not have the hardcoded class name?
<?php
class tc_group {
public $id;
public $password;
private static $tableName = "tc_group";
public static $tblFields = array(
':id' => array('value' => '','required' => 0),
':password' => array('value' => '','required' => 0)
);
public static function createNew($link , $tblfields){
$reftbArr = tc_group::$tblFields;
}
}
?>