예제 #1
0
파일: Workout.php 프로젝트: micheh/yayog
 /**
  * @param Exercise $exercise
  * @return Workout
  */
 public function addExercise(Exercise $exercise)
 {
     $this->exercises[] = $exercise;
     $this->totalSeconds += $exercise->getSeconds();
     $this->totalReps += $exercise->getReps();
     if (!$this->type) {
         $this->type = str_replace(array(' Primary', ' Secondary', ' 6 reps', ' 8 reps', ' 10 reps'), '', $exercise->getType());
     }
     $exercise->setWorkout($this);
     return $this;
 }