protected $_baseController = CubistMagicController::class;
+ protected static array $_reservedNames = ['media'];
+
/**
* @var array
*/
return $attributes;
}
+ protected function checkForReservedNames($name)
+ {
+ if (in_array($name, static::$_reservedNames)) {
+ throw new \Exception(sprintf('The attribute name %s is reserved', $name));
+ }
+ }
+
/**
* @param string|array $name
* @param string $type
{
$attributes = self::normalizeAttributes($name, $type, $label, $attributes);
+ $this->checkForReservedNames($name);
+
$field = $this->bunchAddField($attributes);
$field->setModelInstance($this);
$name = $field->getAttribute('name');