/** * Get printable message for this activity * * @return string */ public function getMessage() { if ($this->type == self::ACTIVITY_SERIES_ADD) { return 'New series "' . $this->object->getTitle() . '" added'; } else { if ($this->type == self::ACTIVITY_VOTE_UP) { return 'Line #' . $this->object->getLine()->getId() . ' voted up'; } else { if ($this->type == self::ACTIVITY_VOTE_DOWN) { return 'Line #' . $this->object->getLine()->getId() . ' voted down'; } else { if ($this->type == self::ACTIVITY_SUGGEST_SERIES) { return 'New series suggested'; } else { if ($this->type == self::ACTIVITY_SUGGEST_SCRIPT) { return 'New script submitted'; } else { if ($this->type == self::ACTIVITY_FLAG) { return 'Line #' . $this->object->getLine()->getId() . ' flagged as bad'; } } } } } } return 'Well, something happened'; }
/** * Logic behind adding a series. * @param Series $series * @return \Altamira\Chart */ public function addSingleSeries(Series $series) { $this->series[$series->getTitle()] = $series; return $this; }