protected function afterDelete() { parent::afterDelete(); // delete images and files when deleting content $image_fields = $this->getFields()->find('type', array(Field\Entity::FIELD_IMAGE, Field\Entity::FIELD_FILE)); foreach ($image_fields as $f) { $c_prop = $this[$f['keyword']]; if (fx::path()->isFile($c_prop)) { fx::files()->rm($c_prop); } } }
protected function afterDelete() { parent::afterDelete(); $path = fx::path()->abs($this->getPath()); fx::files()->rm($path); }
protected function afterDelete() { parent::afterDelete(); fx::alang()->dropDictFiles($this['dict']); }
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(); }