Ejemplo n.º 1
0
 /**
  * set_played
  * this checks to see if the current object has been played
  * if not then it sets it to played. In any case it updates stats.
  * @param int $user
  * @param string $agent
  * @param array $location
  * @return boolean
  */
 public function set_played($user, $agent, $location)
 {
     Stats::insert('podcast', $this->podcast, $user, $agent, $location);
     Stats::insert('podcast_episode', $this->id, $user, $agent, $location);
     if ($this->played) {
         return true;
     }
     /* If it hasn't been played, set it! */
     Podcast_Episode::update_played(true, $this->id);
     return true;
 }