Yam, I keep reporting this - I hope you implement it; it demolishes any chance of having multi-case field names.
The problem?
When a record is grabbed from the db, it is put in an array with the name as the key.
When a record is get or set, it strtolower()s first, meaning it can't find the key if it had capitals. So:
PHP Code:
public function __get($name)
{
$name = strtolower($name);
if(array_key_exists($name, $this->_values))
return stripslashes($this->_values[$name]);
throw new Exception('Invalid offset: '.$name);
}
public function __set($name, $value)
{
if($value instanceof RecordField)
$value = $value->get_value();
$name = strtolower($name);
if(array_key_exists($name, $this->_values))
{
$this->_values[$name] = $value;
return;
}
throw new Exception('Invalid offset: '.$name);
}
should be:
PHP Code:
public function __get($name)
{
if(array_key_exists($name, $this->_values))
return stripslashes($this->_values[$name]);
throw new Exception('Invalid offset: '.$name);
}
public function __set($name, $value)
{
if($value instanceof RecordField)
$value = $value->get_value();
if(array_key_exists($name, $this->_values))
{
$this->_values[$name] = $value;
return;
}
throw new Exception('Invalid offset: '.$name);
}
Thanks
Bookmarks