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

Method setFavorite

lib/Service/ReportService.php:434–445  ·  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

432 * @return bool
433 */
434 public function setFavorite(int $reportId, string $favorite) {
435 $return = true;
436 if ($favorite === 'true') {
437 $return = $this->addFavoriteTag('analytics', $reportId);
438 } else {
439 $favorites = $this->tagManager->load('analytics')->getFavorites();
440 if (is_array($favorites) and in_array($reportId, $favorites)) {
441 $return = $this->removeFavoriteTag('analytics', $reportId);
442 }
443 }
444 return $return;
445 }
446
447 private function addFavoriteTag(string $scope, int $objectId): bool {
448 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