I am using a precreated database table that has spaces in the column names, Active Records kicks back these variables with the spaces in them. It should change the spaces to underscores so the variables can be called.
I overrode _set($name, $value) as a work around:
public function __set($name, $value)
{
$name = str_replace(' ', '_', $name);
$this->$name = $value;
}
i realize you could call it with something like:
$aObject = new ActiveRecordObject();
$var = 'a variable';
$value = $aObject->$var;
but it is rather cumbersome and should be avoided. |