getRelatedRecordObject
Posted: Mon Aug 30, 2010 2:28 am
Hello,
I think there is a problem with related record objects.
The function Dataface_RelatedRecord->_initValues() doesn't take into account that two tables could have the same column names.
For exemple, I have 2 tables table1 and table2 which have each a column named 'id'.
$cols = array('table1.id', 'table2.id')
=> we get only one column name 'id'
I hope I'm clear enough
I think there is a problem with related record objects.
The function Dataface_RelatedRecord->_initValues() doesn't take into account that two tables could have the same column names.
For exemple, I have 2 tables table1 and table2 which have each a column named 'id'.
- Code: Select all
function _initValues(){
[...]
$this->_absoluteColumnNames = array();
//$cols = $this->_relationship->_schema['columns'];
$cols = $this->_relationship->fields(true); // we will get all fields - even grafted ones.
$cols = array('table1.id', 'table2.id')
- Code: Select all
foreach ($cols as $col){
list($table, $field) = explode('.', $col);
$this->_values[$field] = null;
$this->_absoluteColumnNames[$field] = $col;
}
}
}
=> we get only one column name 'id'
I hope I'm clear enough