Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/Tmdb/Factory/TvFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use Tmdb\Model\Common\GenericCollection;
use Tmdb\Model\Common\SpokenLanguage;
use Tmdb\Model\Common\Translation;
use Tmdb\Model\Company;
use Tmdb\Model\Person\CastMember;
use Tmdb\Model\Person\CrewMember;
use Tmdb\Model\Common\ExternalIds;
Expand Down Expand Up @@ -227,6 +228,12 @@ public function create(array $data = [])
$tvShow->setOriginCountry($collection);
}

if (array_key_exists('production_companies', $data)) {
$tvShow->setProductionCompanies(
$this->createGenericCollection($data['production_companies'], new Company())
);
}

if (array_key_exists('created_by', $data) && $data['created_by'] !== null) {
$collection = new GenericCollection();
$factory = new PeopleFactory($this->getHttpClient());
Expand Down
24 changes: 24 additions & 0 deletions lib/Tmdb/Model/Tv.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ class Tv extends AbstractModel
*/
protected $similar;

/**
* @var GenericCollection
*/
protected $productionCompanies;

/**
* Properties that are available in the API
*
Expand Down Expand Up @@ -883,4 +888,23 @@ public function getSimilar()
{
return $this->similar;
}

/**
* @return GenericCollection
*/
public function getProductionCompanies()
{
return $this->productionCompanies;
}

/**
* @param GenericCollection $productionCompanies
* @return $this
*/
public function setProductionCompanies($productionCompanies)
{
$this->productionCompanies = $productionCompanies;

return $this;
}
}