field manager: not allow name same as link

This commit is contained in:
yuri
2017-05-10 12:36:50 +03:00
parent 86be4e7352
commit 20f97caab3
@@ -99,6 +99,9 @@ class FieldManager
if (isset($existingField)) {
throw new Conflict('Field ['.$name.'] exists in '.$scope);
}
if ($this->getMetadata()->get(['entityDefs', $scope, 'links', $name])) {
throw new Conflict('Link with name ['.$name.'] exists in '.$scope);
}
if (in_array($name, $this->forbiddenFieldNameList)) {
throw new Conflict('Field ['.$name.'] is not allowed');
}