session = $this->session_AuthTrait(); $this->class_name = 'Record'; helper($this->class_name); } final protected function getMySocket(): CloudflareSocket { if ($this->_mySocket === null) { $this->_mySocket = new CloudflareSocket(); } return $this->_mySocket; } final protected function getModel(): RecordModel { if ($this->_model === null) { $this->_model = new RecordModel(); } return $this->_model; } final protected function getAccountModel(): AccountModel { if ($this->_accountModel === null) { $this->_accountModel = new AccountModel(); } return $this->_accountModel; } protected function create_init(): void { $this->fields = ['id', 'apikey']; $this->filter_fields = ['status']; $this->action = 'create'; $this->getModel()->setAction($this->action); } public function create_form(): RedirectResponse|string { return $this->create_form_process(); } protected function create_process_submit(): RecordEntity { $Record = new Record( $this->getMySocket(), $this->getModel(), $this->getAccountModel()->getEntityByPK($this->formDatas['account_uid']) ); return $Record->create($this->formDatas); } public function create(): RedirectResponse { return parent::create_process(); } }