/** * Set activity * @param \Runalyze\Model\Activity\Entity $object activity object */ public function setActivity(Model\Activity\Entity $object) { $this->Activity = $object; $this->Dataview = new Dataview($object); $this->Linker = new Linker($object); $this->Sport = $this->Activity->sportid() > 0 ? $this->Factory->sport($this->Activity->sportid()) : null; $this->Type = $this->Activity->typeid() > 0 ? $this->Factory->type($this->Activity->typeid()) : null; $this->ActivityData = $this->Activity->completeData(); $this->IsRunning = $this->hasSport() && $this->Sport->id() == \Runalyze\Configuration::General()->runningSport(); }
/** * Set activity * @param \Runalyze\Model\Activity\Object $object activity object */ public function setActivity(Activity\Object $object) { $this->Activity = $object; $this->Dataview = new Dataview($object); $this->Linker = new Linker($object); $this->Sport = $this->Activity->sportid() > 0 ? $this->Factory->sport($this->Activity->sportid()) : null; $this->Type = $this->Activity->typeid() > 0 ? $this->Factory->type($this->Activity->typeid()) : null; }
/** * Title for this training: type or sport name * @return string */ public function titleByTypeOrSport() { $Factory = new Factory(SessionAccountHandler::getId()); if ($this->Activity->typeid() != 0) { return $Factory->type($this->Activity->typeid())->name(); } return $Factory->sport($this->Activity->sportid())->name(); }