/** * Check if model has any reviews and if so - generate link to edit them * * @param string $objectName * @param int $modelId * @return array */ private function getReviewEditParams($objectName, $modelId) { $objectId = array_search($objectName, Object::getSelectArray()); $reviews = Review::getForObjectModel($modelId, $objectId, 1); if (!empty($reviews)) { return ["label" => Icon::show("pencil") . Yii::t("app", "Edit reviews") . " (" . count($reviews) . ")", "url" => ["/review/backend-review/index", "SearchModel" => ["object_id" => $objectId, "object_model_id" => $modelId]], "target" => "_blank"]; } else { return []; } }