mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Fixed DataObject::dbObject() operation with CompositeDbFields
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63509 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
2a392ef61c
commit
a231c15669
@ -1909,8 +1909,12 @@ class DataObject extends ViewableData implements DataObjectInterface {
|
||||
* @return DBField The field as a DBField object
|
||||
*/
|
||||
public function dbObject($fieldName) {
|
||||
// If we have a CompositeDBField object in $this->record, then return that
|
||||
if(isset($this->record[$fieldName]) && is_object($this->record[$fieldName])) {
|
||||
return $this->record[$fieldName];
|
||||
|
||||
// Special case for ID field
|
||||
if($fieldName == 'ID') {
|
||||
} else if($fieldName == 'ID') {
|
||||
return new PrimaryKey($fieldName, $this);
|
||||
|
||||
// General casting information for items in $db or $casting
|
||||
|
Loading…
Reference in New Issue
Block a user