MCPcopy Create free account
hub / github.com/Rello/analytics / setFavorite

Method setFavorite

lib/Service/ReportService.php:401–412  ·  view source on GitHub ↗

* set/remove the favorite flag for a report * * @param int $reportId * @param string $favorite * @return bool */

(int $reportId, string $favorite)

Source from the content-addressed store, hash-verified

399 * @return bool
400 */
401 public function setFavorite(int $reportId, string $favorite) {
402 $return = true;
403 if ($favorite === 'true') {
404 $return = $this->addFavoriteTag('analytics', $reportId);
405 } else {
406 $favorites = $this->tagManager->load('analytics')->getFavorites();
407 if (is_array($favorites) and in_array($reportId, $favorites)) {
408 $return = $this->removeFavoriteTag('analytics', $reportId);
409 }
410 }
411 return $return;
412 }
413
414 private function addFavoriteTag(string $scope, int $objectId): bool {
415 try {

Callers 4

deleteMethod · 0.95
deleteByUserMethod · 0.95
importMethod · 0.95

Calls 4

addFavoriteTagMethod · 0.95
removeFavoriteTagMethod · 0.95
getFavoritesMethod · 0.80
loadMethod · 0.45