Пример #1
0
 protected function beforeDelete()
 {
     parent::beforeDelete();
     $files = $this->getFileParams();
     foreach ($files as $f) {
         fx::files()->rm($f);
     }
 }
Пример #2
0
 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();
 }
Пример #3
0
 protected function afterDelete()
 {
     parent::afterDelete();
     fx::alang()->dropDictFiles($this['dict']);
 }
Пример #4
0
 protected function afterDelete()
 {
     parent::afterDelete();
     $path = fx::path()->abs($this->getPath());
     fx::files()->rm($path);
 }
Пример #5
0
 protected function afterInsert()
 {
     parent::afterInsert();
     $this->scaffold();
 }
Пример #6
0
 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();
 }