1<?php 2/** 3 * This file is part of the Tmdb PHP API created by Michael Roterman. 4 * 5 * For the full copyright and license information, please view the LICENSE 6 * file that was distributed with this source code. 7 * 8 * @package Tmdb 9 * @author Michael Roterman <michael@wtfz.net> 10 * @copyright (c) 2013, Michael Roterman 11 * @version 0.0.1 12 */ 13namespace Tmdb\Model\Collection; 14 15use Tmdb\Model\Common\GenericCollection; 16use Tmdb\Model\Collection\People\PersonInterface; 17use Tmdb\Model\Person; 18 19/** 20 * Class People 21 * @package Tmdb\Model\Collection 22 */ 23class People extends GenericCollection 24{ 25 /** 26 * Returns all people 27 * 28 * @return Person[] 29 */ 30 public function getPeople() 31 { 32 return $this->data; 33 } 34 35 /** 36 * Retrieve a person from the collection 37 * 38 * @param $id 39 * @return Person 40 */ 41 public function getPerson($id) 42 { 43 return $this->filterId($id); 44 } 45 46 /** 47 * Add a person to the collection 48 * 49 * @param PersonInterface $person 50 */ 51 public function addPerson(PersonInterface $person) 52 { 53 $this->data[] = $person; 54 } 55} 56