public function updateEntry()
{
$this->entry = null;
- return $this->getEntry($this->getCurrentEntryId());
+ return $this->getCurrentEntry();
+ }
+
+ public function setModel($model_namespace)
+ {
+ parent::setModel($model_namespace); // TODO: Change the autogenerated stub
}
public function getValue($key, $default = null)
if (is_array($field)) {
$field = Field::getInstance($field);
}
+ $field->setCrud($this->crud);
if (!$field->getAttribute('fillable', true)) {
$field->setAttribute('type', 'hidden');
}
protected $_isRelationship = false;
+ /** @var CubistCrudPanel */
+ protected $_crud;
+
protected $_columnType = 'text';
protected $_columnMoveAfter = false;
protected $_columnFormat = null;
}
/**
- * @return CubistMagicAbstractModel
+ * @return CubistMagicAbstractModel|null
*/
- public function getModelInstance(): CubistMagicAbstractModel
+ public function getModelInstance(): CubistMagicAbstractModel|null
{
return $this->_modelInstance;
}
return $this;
}
-
public function getDatabaseType()
{
if ($this->getAttribute('translatable')) {
}
return self::$_cachedCan[$permission];
}
+
+ /**
+ * @return CubistCrudPanel
+ */
+ public function getCrud(): CubistCrudPanel|null
+ {
+ return $this->_crud;
+ }
+
+ /**
+ * @param CubistCrudPanel $crud
+ */
+ public function setCrud(CubistCrudPanel $crud): void
+ {
+ $this->_crud = $crud;
+ $this->_postSetCrud();
+ }
+
+ public function issetCrud()
+ {
+ return null !== $this->getCrud();
+ }
+
+ protected function _postSetCrud()
+ {
+
+ }
}
$this->checkForReservedNames($name);
- $field = $this->bunchAddField($attributes);
+ $field = $this->bunchAddField($attributes);;
$field->setModelInstance($this);
$name = $field->getAttribute('name');