public function delete($id) { $item = $this->getById($id); if (!$item) { return false; } /** * @event set_delete */ wa()->event('set_delete', $item); $this->deleteById($id); // delete related info $set_products_model = new shopSetProductsModel(); $set_products_model->deleteByField('set_id', $id); return true; }