for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @file
* Contains \TheSportsDb\Entity\Proxy\SeasonProxy.
*/
namespace TheSportsDb\Entity\Proxy;
use TheSportsDb\Entity\SeasonInterface;
* A season object that is not yet fully loaded.
*
* @author Jelle Sebreghts
class SeasonProxy extends Proxy implements SeasonInterface {
* {@inheritdoc}
public function load() {
$this->loadEvents();
}
* Lazy loads the events for this season.
* @throws \Exception
* When the events cannot be loaded.
* @return void
protected function loadEvents() {
$id = explode('|', $this->getId());
$eventData = $this->sportsDbClient->doRequest('eventsseason.php', array('id' => $this->getLeague()->getId(), 's' => reset($id)));
if (isset($eventData->events)) {
$this->update($this->entityManager->mapProperties((object) array('events' => $eventData->events), $this->getEntityType()));
return;
throw new \Exception('Could not fully load season with id ' . $this->getId() . '.');
public function getId() {
return $this->get('id');
public function getName() {
return $this->get('name');
public function getEvents() {
return $this->get('events');
public function getLeague() {
return $this->get('league');