admin/model/catalog/review/deleteReview/after
13347
public function deleteReview(&$route, &$args, &$output) {
		$this->load->model('report/statistics');

		$this->model_report_statistics->removeValue('review', 1);
	}
1066273
protected function afterDelete()
    {
        parent::afterDelete();
        $this->clearSortingList();

        ProductListStore::instance()->promo_block->clear($this->obElement->id);

        $this->clearCacheNotEmptyValue('hidden', PromoBlockListStore::instance()->hidden);
        $this->clearCacheEmptyValue('hidden', PromoBlockListStore::instance()->not_hidden);

        $this->clearCacheNotEmptyValue('active', PromoBlockListStore::instance()->active);
    }
763322
public function afterFind()
    {
        /** @var ActiveRecord $owner */
        $owner = $this->owner;

        if ($owner->isRelationPopulated('translations') && $related = $owner->getRelatedRecords()['translations']) {
            $translations = $this->indexByLanguage($related);
            foreach ($this->_languageKeys as $language) {
                foreach ($this->attributes as $attribute) {
                    foreach ($translations as $translation) {
                        if ($translation->{$this->languageField} == $language) {
                            $attributeName = $this->localizedPrefix . $attribute;
                            $this->setMultilingualAttribute($this->getAttributeName($attribute, $language), $translation->{$attributeName});
                        }
                    }
                }
            }
        } else if ($owner->getAttribute($this->_ownerPrimaryKey) !== null) {
            if (!$owner->isRelationPopulated('translation')) {
                $owner->translation;
            }

            $translation = $owner->getRelatedRecords()['translation'];
            if ($translation) {
                foreach ($this->attributes as $attribute) {
                    $attribute_name = $this->localizedPrefix . $attribute;
                    $owner->setMultilingualAttribute($attribute, $translation->$attribute_name);
                }
            }
        }

        foreach ($this->attributes as $attribute) {
            if ($owner->hasAttribute($attribute) && $this->getMultilingualAttribute($attribute)) {
                $owner->setAttribute($attribute, $this->getMultilingualAttribute($attribute));
            }
        }
    }
390243
public function delete()
    {
        $this->resetContentCache();

        $reviewId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("rev_oxid");
        $review = oxNew(\OxidEsales\Eshop\Application\Model\Review::class);
        $review->load($reviewId);
        $review->delete();

        // recalculating article average rating
        $rating = oxNew(\OxidEsales\Eshop\Application\Model\Rating::class);
        $articleId = $this->getEditObjectId();

        $article = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
        $article->load($articleId);

        //switch database connection to master for the following read/write access.
        \OxidEsales\Eshop\Core\DatabaseProvider::getMaster();
        $article->setRatingAverage($rating->getRatingAverage($articleId, 'oxarticle'));
        $article->setRatingCount($rating->getRatingCount($articleId, 'oxarticle'));
        $article->save();
    }
952624
public function afterDelete()
    {
        parent::afterDelete();
        Tag::updateFrequency($this->tags, '');
        Vote::removeRelation($this);
        Answer::removeRelation($this->id);
        Favorite::removeRelation($this->id);
    }
93954
public function editList()
    {
        if (!\OxidEsales\Eshop\Core\Registry::getSession()->checkSessionChallenge()) {
            return;
        }

        if (!$this->getViewConfig()->getShowListmania()) {
            return;
        }

        // deleting on demand
        if (($sAction = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('deleteList')) &&
            ($oRecommList = $this->getActiveRecommList())
        ) {
            $oRecommList->delete();
            $this->setActiveRecommList(false);
        } else {
            $this->_sThisTemplate = 'page/account/recommendationedit.tpl';
        }
    }
860668
public function editReview($product_id, $review_id = null)
    {
        $this->setProductReview($product_id);
        $this->setReview($review_id);
        $this->setTitleEditReview();
        $this->setBreadcrumbEditReview();

        $this->setData('review', $this->data_review);
        $this->setData('product', $this->data_product);
        $this->setData('can_delete', $this->canDeleteReview());

        $this->submitEditReview();
        $this->setDataRatingEditReview();
        $this->outputEditReview();
    }
474740
public function DeleteReview()
    {
        $oGlobal = TGlobal::instance();
        $oMsgManager = TCMSMessageManager::GetInstance();
        if ($oGlobal->UserDataExists(TdbShopArticleReview::URL_PARAM_ACTION_ID)) {
            $this->DeleteReviewFromActionId();
        } elseif ($oGlobal->UserDataExists(TdbShopArticleReview::URL_PARAM_REVIEW_ID)) {
            $this->DeleteReviewFromOwner();
        } else {
            $oMsgManager->AddMessage(self::MSG_CONSUMER_NAME, 'ARTICLE-REVIEW-ACTION-MISSING-PARAMETER');
        }
        $this->RedirectToItemPage();
    }
240699
function (todo) {
      model.remove(todo.id, function () {
        todos.splice(todos.indexOf(todo), 1);
        if (todo.completed) {
          completedCount--;
        } else {
          itemsLeft--;
          checkedAll = completedCount === todos.length;
        }
      });
    }
1216445
protected function after() {
		if($this->connection->getDatabasePlatform() instanceof SQLServerPlatform) {
			$this->connection->executeUpdate('exec sp_msforeachtable "ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all"');
		} else if($this->connection->getDatabasePlatform() instanceof MySqlPlatform) {
			$this->connection->executeUpdate('SET FOREIGN_KEY_CHECKS=1');
		} else if($this->connection->getDatabasePlatform() instanceof SqlitePlatform) {
			$this->connection->executeUpdate('PRAGMA foreign_keys = ON');
		}
	}
1073962
protected function updateReview()
    {
        $submitted = $this->getSubmitted();

        if ($this->review->update($this->data_review['review_id'], $submitted)) {

            $message = $this->text('Review has been updated');

            if (empty($submitted['status'])) {
                $message = $this->text('Review has been updated and will be published after approval');
            }

            $this->redirect("product/{$this->data_product['product_id']}", $message, 'success');
        }

        $this->redirect("product/{$this->data_product['product_id']}");
    }
542224
public function postDelete()
    {
        if ((!isset($this->revisionEnabled) || $this->revisionEnabled)
            && $this->isSoftDelete()
            && $this->isRevisionable($this->getDeletedAtColumn())) {
            $revisions[] = array(
                'revisionable_type' => $this->getMorphClass(),
                'revisionable_id' => $this->getKey(),
                'key' => $this->getDeletedAtColumn(),
                'old_value' => null,
                'new_value' => $this->{$this->getDeletedAtColumn()},
                'user_id' => $this->getSystemUserId(),
                'created_at' => new \DateTime(),
                'updated_at' => new \DateTime(),
            );
            $revision = static::newModel();
            \DB::table($revision->getTable())->insert($revisions);
        }
    }
1349669
protected function DeleteReviewFromOwner()
    {
        $oReviewItem = TdbShopArticleReview::GetNewInstance();
        $oGlobal = TGlobal::instance();
        $oMsgManager = TCMSMessageManager::GetInstance();
        if ($oReviewItem->Load($oGlobal->GetUserData(TdbShopArticleReview::URL_PARAM_REVIEW_ID)) && $oReviewItem->IsOwner()) {
            $this->DeleteConnectedComments($oReviewItem);
            $oReviewItem->AllowEditByAll(true);
            $oReviewItem->Delete();
            $oMsgManager->AddMessage(self::MSG_CONSUMER_NAME, 'ARTICLE-REVIEW-DELETE-SUCCESS');
        } else {
            $oMsgManager->AddMessage(self::MSG_CONSUMER_NAME, 'ARTICLE-REVIEW-ACTION-REVIEW-NOT-FOUND');
        }
    }
1108328
function definition_after_data() {
        global $CFG, $COURSE;

        $mform =& $this->_form;

        if ($id = $mform->getElementValue('id')) {
            $gradeitem = grade_item::fetch(array('id' => $id));
            $parentcategory = $gradeitem->get_parent_category();
        } else {
            // If we do not have an id, we are creating a new grade item.
            $gradeitem = new grade_item(array('courseid' => $COURSE->id, 'itemtype' => 'manual'), false);

            // Assign the course category to this grade item.
            $parentcategory = grade_category::fetch_course_category($COURSE->id);
            $gradeitem->parent_category = $parentcategory;
        }

        if (!$gradeitem->is_raw_used()) {
            $mform->removeElement('plusfactor');
            $mform->removeElement('multfactor');
        }

        if ($gradeitem->is_outcome_item()) {
            // We have to prevent incompatible modifications of outcomes if outcomes disabled.
            $mform->removeElement('grademax');
            if ($mform->elementExists('grademin')) {
                $mform->removeElement('grademin');
            }
            $mform->removeElement('gradetype');
            $mform->removeElement('display');
            $mform->removeElement('decimals');
            $mform->hardFreeze('scaleid');

        } else {
            if ($gradeitem->is_external_item()) {
                // Following items are set up from modules and should not be overrided by user.
                if ($mform->elementExists('grademin')) {
                    // The site setting grade_report_showmin may have prevented grademin being added to the form.
                    $mform->hardFreeze('grademin');
                }
                $mform->hardFreeze('itemname,gradetype,grademax,scaleid');
                if ($gradeitem->itemnumber == 0) {
                    // The idnumber of grade itemnumber 0 is synced with course_modules.
                    $mform->hardFreeze('idnumber');
                }

                // For external items we can not change the grade type, even if no grades exist, so if it is set to
                // scale, then remove the grademax and grademin fields from the form - no point displaying them.
                if ($gradeitem->gradetype == GRADE_TYPE_SCALE) {
                    $mform->removeElement('grademax');
                    if ($mform->elementExists('grademin')) {
                        $mform->removeElement('grademin');
                    }
                } else { // Not using scale, so remove it.
                    $mform->removeElement('scaleid');
                }

                // Always remove the rescale grades element if it's an external item.
                $mform->removeElement('rescalegrades');
            } else if ($gradeitem->has_grades()) {
                // Can't change the grade type or the scale if there are grades.
                $mform->hardFreeze('gradetype, scaleid');

                // If we are using scales then remove the unnecessary rescale and grade fields.
                if ($gradeitem->gradetype == GRADE_TYPE_SCALE) {
                    $mform->removeElement('rescalegrades');
                    $mform->removeElement('grademax');
                    if ($mform->elementExists('grademin')) {
                        $mform->removeElement('grademin');
                    }
                } else { // Remove the scale field.
                    $mform->removeElement('scaleid');
                    // Set the maximum grade to disabled unless a grade is chosen.
                    $mform->disabledIf('grademax', 'rescalegrades', 'eq', '');
                }
            } else {
                // Remove the rescale element if there are no grades.
                $mform->removeElement('rescalegrades');
            }
        }

        // If we wanted to change parent of existing item - we would have to verify there are no circular references in parents!!!
        if ($id && $mform->elementExists('parentcategory')) {
            $mform->hardFreeze('parentcategory');
        }

        $parentcategory->apply_forced_settings();

        if (!$parentcategory->is_aggregationcoef_used()) {
            if ($mform->elementExists('aggregationcoef')) {
                $mform->removeElement('aggregationcoef');
            }

        } else {
            $coefstring = $gradeitem->get_coefstring();

            if ($coefstring !== '') {
                if ($coefstring == 'aggregationcoefextrasum' || $coefstring == 'aggregationcoefextraweightsum') {
                    // The advcheckbox is not compatible with disabledIf!
                    $coefstring = 'aggregationcoefextrasum';
                    $element =& $mform->createElement('checkbox', 'aggregationcoef', get_string($coefstring, 'grades'));
                } else {
                    $element =& $mform->createElement('text', 'aggregationcoef', get_string($coefstring, 'grades'));
                }
                if ($mform->elementExists('parentcategory')) {
                    $mform->insertElementBefore($element, 'parentcategory');
                } else {
                    $mform->insertElementBefore($element, 'id');
                }
                $mform->addHelpButton('aggregationcoef', $coefstring, 'grades');
            }
            $mform->disabledIf('aggregationcoef', 'gradetype', 'eq', GRADE_TYPE_NONE);
            $mform->disabledIf('aggregationcoef', 'gradetype', 'eq', GRADE_TYPE_TEXT);
            $mform->disabledIf('aggregationcoef', 'parentcategory', 'eq', $parentcategory->id);
        }

        // Remove fields used by natural weighting if the parent category is not using natural weighting.
        // Or if the item is a scale and scales are not used in aggregation.
        if ($parentcategory->aggregation != GRADE_AGGREGATE_SUM
                || (empty($CFG->grade_includescalesinaggregation) && $gradeitem->gradetype == GRADE_TYPE_SCALE)) {
            if ($mform->elementExists('weightoverride')) {
                $mform->removeElement('weightoverride');
            }
            if ($mform->elementExists('aggregationcoef2')) {
                $mform->removeElement('aggregationcoef2');
            }
        }

        if ($category = $gradeitem->get_item_category()) {
            if ($category->aggregation == GRADE_AGGREGATE_SUM) {
                if ($mform->elementExists('gradetype')) {
                    $mform->hardFreeze('gradetype');
                }
                if ($mform->elementExists('grademin')) {
                    $mform->hardFreeze('grademin');
                }
                if ($mform->elementExists('grademax')) {
                    $mform->hardFreeze('grademax');
                }
                if ($mform->elementExists('scaleid')) {
                    $mform->removeElement('scaleid');
                }
            }
        }

        // no parent header for course category
        if (!$mform->elementExists('aggregationcoef') and !$mform->elementExists('parentcategory')) {
            $mform->removeElement('headerparent');
        }
    }
232102
protected function performDeleteOnModel()
	{
		$query = $this->newQuery()->where($this->getKeyName(), $this->getKey());

		if ($this->softDelete)
		{
			$this->{static::DELETED_AT} = $time = $this->freshTimestamp();

			$query->update(array(static::DELETED_AT => $this->fromDateTime($time)));
		}
		else
		{
			$query->delete();
		}
	}
853954
public function afterDelete()
    {
        parent::afterDelete();
        Comment::deleteAll(['model' => self::COMMENT_FOR, 'parent_id' => $this->id]);
        Tag::updateFrequency($this->tags, '');
        PostAuthor::updateAuthors($this->id, $this->_oldAuthors, []);
    }
563469
protected function performAction()
    {
        $count = $this->db->delete("gems__appointments", $this->getWhere());

        $this->addMessage(sprintf($this->plural(
                '%d appointment deleted.',
                '%d appointments deleted.',
                $count
                ), $count));


        $this->setAfterCleanupRoute();
    }