コード例 #1
0
ファイル: Entity.php プロジェクト: floxim/floxim
 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);
         }
     }
 }
コード例 #2
0
ファイル: Entity.php プロジェクト: floxim/floxim
 protected function afterDelete()
 {
     parent::afterDelete();
     $path = fx::path()->abs($this->getPath());
     fx::files()->rm($path);
 }
コード例 #3
0
ファイル: Entity.php プロジェクト: floxim/floxim
 protected function afterDelete()
 {
     parent::afterDelete();
     fx::alang()->dropDictFiles($this['dict']);
 }
コード例 #4
0
ファイル: Entity.php プロジェクト: floxim/floxim
 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();
 }