protected function beforeDelete() { parent::beforeDelete(); $files = $this->getFileParams(); foreach ($files as $f) { fx::files()->rm($f); } }
public function validate() { $fields = $this->getComponent()->getAllFields(); foreach ($fields as $f) { if ($f['is_required'] && !$this[$f['keyword']]) { $this->invalid($f['name'] . ': ' . fx::lang('This field is required'), $f['keyword']); } } return parent::validate(); }
protected function afterDelete() { parent::afterDelete(); fx::alang()->dropDictFiles($this['dict']); }
protected function afterDelete() { parent::afterDelete(); $path = fx::path()->abs($this->getPath()); fx::files()->rm($path); }
protected function afterInsert() { parent::afterInsert(); $this->scaffold(); }
protected function afterDelete() { if ($this['component_id']) { if (self::getSqlTypeByType($this->data['type'])) { try { fx::db()->query("ALTER TABLE `{{" . $this->getTable() . "}}` DROP COLUMN `" . $this['keyword'] . "`"); } catch (\Exception $e) { fx::log('Drop field exception', $e->getMessage()); } } } parent::afterDelete(); }