/** * Try delete related thumb file before deleting file entity itself * * @return void */ function beforeDelete() { parent::beforeDelete(); $this->ref('thumb_file_id')->tryDelete(); }