diff --git a/core/model/DataObject.php b/core/model/DataObject.php index 46f12b75f..1d85a8a2d 100644 --- a/core/model/DataObject.php +++ b/core/model/DataObject.php @@ -1222,6 +1222,17 @@ class DataObject extends ViewableData implements DataObjectInterface { return array_key_exists($field, $this->record); } + /** + * Returns true if the given field exists as a database column + * + * @param string $field Name of the field + * + * @return boolean + */ + public function hasDatabaseField($field) { + return array_key_exists($field, $this->databaseFields()); + } + /** * Returns true if the member is allowed to do the given action. *