mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Fixed DataObject::hasDatabaseField() for built-in fields (Created, etc)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66110 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
3d9532db83
commit
5df7237a93
@ -1756,6 +1756,18 @@ class DataObject extends ViewableData implements DataObjectInterface,i18nEntityP
|
|||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function hasDatabaseField($field) {
|
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());
|
return array_key_exists($field, $this->inheritedDatabaseFields());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user