mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX: Merged from trunk; fix DataObject::hasDatabaseFields()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@66269 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
0eac163b11
commit
b40dbbb2f0
@ -1756,6 +1756,18 @@ class DataObject extends ViewableData implements DataObjectInterface,i18nEntityP
|
||||
* @return boolean
|
||||
*/
|
||||
public function hasDatabaseField($field) {
|
||||
$fixedFields = array(
|
||||
'ID' => 'Int',
|
||||
'ClassName' => 'Enum',
|
||||
'LastEdited' => 'SSDatetime',
|
||||
'Created' => 'SSDatetime',
|
||||
// Add fields from Versioned decorator
|
||||
'Version' => $this->hasExtension('Versioned') ? 'Int' : false,
|
||||
);
|
||||
|
||||
// Add base fields which are not defined in static $db
|
||||
if(isset($fixedFields[$field])) return (bool)$fixedFields[$field];
|
||||
|
||||
return array_key_exists($field, $this->inheritedDatabaseFields());
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user