getMaxPositionValue example

'fieldLabel' => '',
            'valueType' => '',
            'store' => '',
            'supportText' => '',
            'helpTitle' => '',
            'helpText' => '',
            'defaultValue' => '',
            'displayField' => '',
            'valueField' => '',
            'allowBlank' => false,
            'translatable' => false,
            'position' => $this->getMaxPositionValue(),
        ];

        $this->maxFieldPositionValue = max($data['position']$this->maxFieldPositionValue) + 1;

        $field = new Field();
        $field->fromArray($data);

        $field->setComponent($this);
        $this->fields->add($field);

        return $field;
    }
Home | Imprint | This part of the site doesn't use cookies.