From f2f4e086e631eb4ab0e5413152c25e49e5f73049 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20H=C3=BCbner?= Date: Sun, 20 Nov 2016 23:57:38 +0100 Subject: [PATCH] Update Brickset client + Fix coding style --- src/AppBundle/Client/Brickset/Brickset.php | 306 ++++++---- .../Brickset/Entity/AdditionalImage.php | 34 +- .../Client/Brickset/Entity/Instructions.php | 23 +- .../Client/Brickset/Entity/Review.php | 146 +++-- src/AppBundle/Client/Brickset/Entity/Set.php | 562 ++++++++---------- .../Client/Brickset/Entity/Subtheme.php | 119 ++++ .../Client/Brickset/Entity/Theme.php | 117 ++++ src/AppBundle/Client/Brickset/Entity/Year.php | 78 +++ 8 files changed, 849 insertions(+), 536 deletions(-) create mode 100644 src/AppBundle/Client/Brickset/Entity/Subtheme.php create mode 100644 src/AppBundle/Client/Brickset/Entity/Theme.php create mode 100644 src/AppBundle/Client/Brickset/Entity/Year.php diff --git a/src/AppBundle/Client/Brickset/Brickset.php b/src/AppBundle/Client/Brickset/Brickset.php index f731209..458beb7 100644 --- a/src/AppBundle/Client/Brickset/Brickset.php +++ b/src/AppBundle/Client/Brickset/Brickset.php @@ -6,12 +6,15 @@ use AppBundle\Client\Brickset\Entity\AdditionalImage; use AppBundle\Client\Brickset\Entity\Instructions; use AppBundle\Client\Brickset\Entity\Review; use AppBundle\Client\Brickset\Entity\Set; +use AppBundle\Client\Brickset\Entity\Subtheme; +use AppBundle\Client\Brickset\Entity\Theme; +use AppBundle\Client\Brickset\Entity\Year; use Symfony\Component\Asset\Exception\LogicException; use Symfony\Component\Debug\Exception\ContextErrorException; class Brickset extends \SoapClient { - const WSDL = 'http://brickset.com/api/v2.asmx?WSDL'; + const WSDL = 'http://brickset.com/api/v2.asmx?WSDL'; private $apiKey = ''; private $userHash = ''; @@ -24,6 +27,9 @@ class Brickset extends \SoapClient 'additionalImages' => AdditionalImage::class, 'instructions' => Instructions::class, 'reviews' => Review::class, + 'themes' => Theme::class, + 'subthemes' => Subtheme::class, + 'years' => Year::class, ); /** @@ -54,49 +60,46 @@ class Brickset extends \SoapClient $this->apiKey = $apiKey; } - /** - * @param $query - * @param $theme - * @param $subtheme - * @param $setNumber - * @param $year - * @param $owned - * @param $wanted - * @param $orderBy - * @param $pageSize - * @param $pageNumber - * @param $userName - * - * @return Set[] - */ - public function getSets($query, $theme, $subtheme, $setNumber, $year, $owned, $wanted, $orderBy, $pageSize, $pageNumber, $userName) + private function call($method, $parameters) { - $parameters = [ - 'apiKey' => $this->apiKey, - 'userHash' => $this->userHash, - 'query' => $query, - 'theme' => $theme, - 'subtheme' => $subtheme, - 'setNumber' => $setNumber, - 'year' => $year, - 'owned' => $owned, - 'wanted' => $wanted, - 'orderBy' => $orderBy, - 'pageSize' => $pageSize, - 'pageNumber' => $pageNumber, - 'userName' => $userName, - ]; + $parameters['apiKey'] = $this->apiKey; try { - return $this->__soapCall('getSets', [$parameters])->getSetsResult->sets; - } catch (ContextErrorException $e) { - return []; + return $this->__soapCall($method, [$parameters]); } catch (\SoapFault $e) { //TODO throw new LogicException($e->getCode().' - '.$e->getMessage()); } } + /** + * Retrieve a list of sets. + * + * @param array $parameters + * + * @return Set[] + */ + public function getSets($parameters) + { + $parameters['userHash'] = $this->userHash; + + // Add blank required parameters to api call in order to recieve response + $required_keys = ['query', 'theme', 'subtheme', 'setNumber', 'year', 'owned', 'wanted', 'orderBy', 'pageSize', 'pageNumber', 'userName']; + foreach ($required_keys as $key) { + if (!array_key_exists($key, $parameters)) { + $parameters[$key] = ''; + } + } + + try { + $response = $this->call('getSets', $parameters)->getSetsResult->sets; + + return is_array($response) ? $response : [$response]; + } catch (ContextErrorException $e) { + return []; + } + } + /** * @param $SetID * @@ -104,139 +107,180 @@ class Brickset extends \SoapClient */ public function getSet($SetID) { - $parameters = [ - 'apiKey' => $this->apiKey, - 'userHash' => $this->userHash, - 'SetID' => $SetID, - ]; + $parameters = ['userHash' => $this->userHash, 'SetID' => $SetID]; try { - return $this->__soapCall('getSet', [$parameters])->getSetResult->sets[0]; + return $this->call('getSet', $parameters)->getSetResult->sets; } catch (ContextErrorException $e) { return null; - } catch (\SoapFault $e) { - //TODO - throw new LogicException($e->getCode().' - '.$e->getMessage()); } } /** + * Get a list of sets that have changed in the last {minutesAgo} minutes. + * * @param int $minutesAgo * * @return Set[] */ public function getRecentlyUpdatedSets($minutesAgo) { - $parameters = [ - 'apiKey' => $this->apiKey, - 'minutesAgo' => $minutesAgo, - ]; + $parameters = ['minutesAgo' => $minutesAgo]; try { - return $this->__soapCall('getRecentlyUpdatedSets', [$parameters])->getRecentlyUpdatedSetsResult->sets; + $response = $this->call('getRecentlyUpdatedSets', $parameters)->getRecentlyUpdatedSetsResult->sets; + + return is_array($response) ? $response : [$response]; } catch (ContextErrorException $e) { return []; - } catch (\SoapFault $e) { - //TODO - throw new LogicException($e->getCode().' - '.$e->getMessage()); } } /** - * @param $setID + * Get a list of URLs of additional set images for the specified set. + * + * @param int $setID Brickset unique id of set * * @return AdditionalImage[] */ public function getAdditionalImages($setID) { - $parameters = [ - 'apiKey' => $this->apiKey, - 'setID' => $setID, - ]; + $parameters = ['setID' => $setID]; try { - return $this->__soapCall('getAdditionalImages', [$parameters])->getAdditionalImagesResult->additionalImages; + $response = $this->call('getAdditionalImages', $parameters)->getAdditionalImagesResult->additionalImages; + + return is_array($response) ? $response : [$response]; } catch (ContextErrorException $e) { return []; - } catch (\SoapFault $e) { - //TODO - throw new LogicException($e->getCode().' - '.$e->getMessage()); - } - } - - public function getReviews($setID) - { - $parameters = [ - 'apiKey' => $this->apiKey, - 'setID' => $setID, - ]; - - try { - return $this->__soapCall('getReviews', [$parameters])->getReviewsResult->reviews; - } catch (ContextErrorException $e) { - return []; - } catch (\SoapFault $e) { - //TODO - throw new LogicException($e->getCode().' - '.$e->getMessage()); - } - } - - public function getInstructions($setID) - { - $parameters = [ - 'apiKey' => $this->apiKey, - 'setID' => $setID, - ]; - - try { - return $this->__soapCall('getInstructions', [$parameters])->getInstructionsResult->instructions; - } catch (ContextErrorException $e) { - return []; - } catch (\SoapFault $e) { - //TODO - throw new LogicException($e->getCode().' - '.$e->getMessage()); - } - } - - public function login($username, $password) - { - $parameters = [ - 'apiKey' => $this->apiKey, - 'username' => $username, - 'password' => $password, - ]; - - try { - $response = $this->__soapCall('login', [$parameters])->loginResult; - if ($response == 'INVALIDKEY') { - return false; - } elseif (strpos($response, 'ERROR:') === 0) { - return false; - } else { - $this->userHash = $response; - - return true; - } - } catch (\SoapFault $e) { - //TODO - throw new LogicException($e->getCode().' - '.$e->getMessage()); } } /** - * @return mixed + * Get the reviews for the specified set. + * + * @param int $setID Brickset unique id of set + * + * @return Review[] + */ + public function getReviews($setID) + { + $parameters = ['setID' => $setID]; + + try { + $response = $this->call('getReviews', $parameters)->getReviewsResult->reviews; + + return is_array($response) ? $response : [$response]; + } catch (ContextErrorException $e) { + return []; + } + } + + /** + * Get a list of instructions for the specified set. + * + * @param int $setID Brickset unique id of set + * + * @return Instructions[] + */ + public function getInstructions($setID) + { + $parameters = ['setID' => $setID]; + + try { + $response = $this->call('getInstructions', $parameters)->getInstructionsResult->instructions; + + return is_array($response) ? $response : [$response]; + } catch (ContextErrorException $e) { + return null; + } + } + + /** + * Get a list of themes, with the total number of sets in each. + * + * @return Theme[] + */ + public function getThemes() + { + try { + return $this->call('getThemes', [])->getThemesResult->themes; + } catch (ContextErrorException $e) { + return []; + } + } + + /** + * Get a list of subthemes for a given theme, with the total number of sets in each. + * + * @param string $theme Name of theme + * + * @return Subtheme[] + */ + public function getSubthemes($theme) + { + $parameters = ['theme' => $theme]; + + try { + $response = $this->call('getSubthemes', $parameters)->getSubthemesResult->subthemes; + + return is_array($response) ? $response : [$response]; + } catch (ContextErrorException $e) { + return []; + } + } + + /** + * Get a list of years for a given theme, with the total number of sets in each. + * + * @param string $theme Name of theme + * + * @return Year[] + */ + public function getYears($theme) + { + $parameters = ['theme' => $theme]; + + try { + $response = $this->call('getYears', $parameters)->getYearsResult->years; + + return is_array($response) ? $response : [$response]; + } catch (ContextErrorException $e) { + return []; + } + } + + /** + * Log in as a user and retrieve a token that can be used in subsequent API calls. + * + * @param string $username + * @param string $password + * + * @return bool True if successful + */ + public function login($username, $password) + { + $parameters = ['username' => $username, 'password' => $password]; + + $response = $this->call('login', $parameters)->loginResult; + if ($response == 'INVALIDKEY') { + return false; + } elseif (strpos($response, 'ERROR:') === 0) { + return false; + } else { + $this->userHash = $response; + + return true; + } + } + + /** + * Check if an API key is valid. + * + * @return bool */ public function checkKey() { - $parameters = [ - 'apiKey' => $this->apiKey, - ]; - - try { - return ($this->__soapCall('checkKey', [$parameters])->checkKeyResult) == 'OK' ? true : false; - } catch (\SoapFault $e) { - //TODO - throw new LogicException($e->getCode().' - '.$e->getMessage()); - } + return ($this->call('checkKey', [])->checkKeyResult) == 'OK' ? true : false; } } diff --git a/src/AppBundle/Client/Brickset/Entity/AdditionalImage.php b/src/AppBundle/Client/Brickset/Entity/AdditionalImage.php index 7b8ba1e..cc11372 100644 --- a/src/AppBundle/Client/Brickset/Entity/AdditionalImage.php +++ b/src/AppBundle/Client/Brickset/Entity/AdditionalImage.php @@ -4,26 +4,23 @@ namespace AppBundle\Client\Brickset\Entity; class AdditionalImage { - /** - * @var string $thumbnailURL + * @var string */ protected $thumbnailURL = null; /** - * @var string $largeThumbnailURL + * @var string */ protected $largeThumbnailURL = null; /** - * @var string $imageURL + * @var string */ protected $imageURL = null; - public function __construct() { - } /** @@ -31,17 +28,19 @@ class AdditionalImage */ public function getThumbnailURL() { - return $this->thumbnailURL; + return $this->thumbnailURL; } /** * @param string $thumbnailURL + * * @return AdditionalImage */ public function setThumbnailURL($thumbnailURL) { - $this->thumbnailURL = $thumbnailURL; - return $this; + $this->thumbnailURL = $thumbnailURL; + + return $this; } /** @@ -49,17 +48,19 @@ class AdditionalImage */ public function getLargeThumbnailURL() { - return $this->largeThumbnailURL; + return $this->largeThumbnailURL; } /** * @param string $largeThumbnailURL + * * @return AdditionalImage */ public function setLargeThumbnailURL($largeThumbnailURL) { - $this->largeThumbnailURL = $largeThumbnailURL; - return $this; + $this->largeThumbnailURL = $largeThumbnailURL; + + return $this; } /** @@ -67,17 +68,18 @@ class AdditionalImage */ public function getImageURL() { - return $this->imageURL; + return $this->imageURL; } /** * @param string $imageURL + * * @return AdditionalImage */ public function setImageURL($imageURL) { - $this->imageURL = $imageURL; - return $this; - } + $this->imageURL = $imageURL; + return $this; + } } diff --git a/src/AppBundle/Client/Brickset/Entity/Instructions.php b/src/AppBundle/Client/Brickset/Entity/Instructions.php index 61c3ca3..c1e3bc0 100644 --- a/src/AppBundle/Client/Brickset/Entity/Instructions.php +++ b/src/AppBundle/Client/Brickset/Entity/Instructions.php @@ -5,19 +5,17 @@ namespace AppBundle\Client\Brickset\Entity; class Instructions { /** - * @var string $URL + * @var string */ protected $URL = null; /** - * @var string $description + * @var string */ protected $description = null; - public function __construct() { - } /** @@ -25,17 +23,19 @@ class Instructions */ public function getURL() { - return $this->URL; + return $this->URL; } /** * @param string $URL + * * @return Instructions */ public function setURL($URL) { - $this->URL = $URL; - return $this; + $this->URL = $URL; + + return $this; } /** @@ -43,17 +43,18 @@ class Instructions */ public function getDescription() { - return $this->description; + return $this->description; } /** * @param string $description + * * @return Instructions */ public function setDescription($description) { - $this->description = $description; - return $this; - } + $this->description = $description; + return $this; + } } diff --git a/src/AppBundle/Client/Brickset/Entity/Review.php b/src/AppBundle/Client/Brickset/Entity/Review.php index 2daae88..8a31cc2 100644 --- a/src/AppBundle/Client/Brickset/Entity/Review.php +++ b/src/AppBundle/Client/Brickset/Entity/Review.php @@ -4,75 +4,74 @@ namespace AppBundle\Client\Brickset\Entity; class Review { - /** - * @var string $author + * @var string */ protected $author = null; /** - * @var \DateTime $datePosted + * @var \DateTime */ protected $datePosted = null; /** - * @var int $overallRating + * @var int */ protected $overallRating = null; /** - * @var int $parts + * @var int */ protected $parts = null; /** - * @var int $buildingExperience + * @var int */ protected $buildingExperience = null; /** - * @var int $playability + * @var int */ protected $playability = null; /** - * @var int $valueForMoney + * @var int */ protected $valueForMoney = null; /** - * @var string $title + * @var string */ protected $title = null; /** - * @var string $review + * @var string */ protected $review = null; /** - * @var boolean $HTML + * @var bool */ protected $HTML = null; /** * @param \DateTime $datePosted - * @param int $overallRating - * @param int $parts - * @param int $buildingExperience - * @param int $playability - * @param int $valueForMoney - * @param boolean $HTML + * @param int $overallRating + * @param int $parts + * @param int $buildingExperience + * @param int $playability + * @param int $valueForMoney + * @param bool $HTML */ public function __construct(\DateTime $datePosted, $overallRating, $parts, $buildingExperience, $playability, $valueForMoney, $HTML) { - $this->datePosted = $datePosted->format(\DateTime::ATOM); - $this->overallRating = $overallRating; - $this->parts = $parts; - $this->buildingExperience = $buildingExperience; - $this->playability = $playability; - $this->valueForMoney = $valueForMoney; - $this->HTML = $HTML; + $this->datePosted = $datePosted->format(\DateTime::ATOM); + $this->overallRating = $overallRating; + $this->parts = $parts; + $this->buildingExperience = $buildingExperience; + $this->playability = $playability; + $this->valueForMoney = $valueForMoney; + $this->HTML = $HTML; } /** @@ -80,17 +79,19 @@ class Review */ public function getAuthor() { - return $this->author; + return $this->author; } /** * @param string $author + * * @return Review */ public function setAuthor($author) { - $this->author = $author; - return $this; + $this->author = $author; + + return $this; } /** @@ -98,25 +99,27 @@ class Review */ public function getDatePosted() { - if ($this->datePosted == null) { - return null; - } else { - try { - return new \DateTime($this->datePosted); - } catch (\Exception $e) { - return null; + if ($this->datePosted == null) { + return null; + } else { + try { + return new \DateTime($this->datePosted); + } catch (\Exception $e) { + return null; + } } - } } /** * @param \DateTime $datePosted + * * @return Review */ public function setDatePosted(\DateTime $datePosted) { - $this->datePosted = $datePosted->format(\DateTime::ATOM); - return $this; + $this->datePosted = $datePosted->format(\DateTime::ATOM); + + return $this; } /** @@ -124,17 +127,19 @@ class Review */ public function getOverallRating() { - return $this->overallRating; + return $this->overallRating; } /** * @param int $overallRating + * * @return Review */ public function setOverallRating($overallRating) { - $this->overallRating = $overallRating; - return $this; + $this->overallRating = $overallRating; + + return $this; } /** @@ -142,17 +147,19 @@ class Review */ public function getParts() { - return $this->parts; + return $this->parts; } /** * @param int $parts + * * @return Review */ public function setParts($parts) { - $this->parts = $parts; - return $this; + $this->parts = $parts; + + return $this; } /** @@ -160,17 +167,19 @@ class Review */ public function getBuildingExperience() { - return $this->buildingExperience; + return $this->buildingExperience; } /** * @param int $buildingExperience + * * @return Review */ public function setBuildingExperience($buildingExperience) { - $this->buildingExperience = $buildingExperience; - return $this; + $this->buildingExperience = $buildingExperience; + + return $this; } /** @@ -178,17 +187,19 @@ class Review */ public function getPlayability() { - return $this->playability; + return $this->playability; } /** * @param int $playability + * * @return Review */ public function setPlayability($playability) { - $this->playability = $playability; - return $this; + $this->playability = $playability; + + return $this; } /** @@ -196,17 +207,19 @@ class Review */ public function getValueForMoney() { - return $this->valueForMoney; + return $this->valueForMoney; } /** * @param int $valueForMoney + * * @return Review */ public function setValueForMoney($valueForMoney) { - $this->valueForMoney = $valueForMoney; - return $this; + $this->valueForMoney = $valueForMoney; + + return $this; } /** @@ -214,17 +227,19 @@ class Review */ public function getTitle() { - return $this->title; + return $this->title; } /** * @param string $title + * * @return Review */ public function setTitle($title) { - $this->title = $title; - return $this; + $this->title = $title; + + return $this; } /** @@ -232,35 +247,38 @@ class Review */ public function getReview() { - return $this->review; + return $this->review; } /** * @param string $review + * * @return Review */ public function setReview($review) { - $this->review = $review; - return $this; + $this->review = $review; + + return $this; } /** - * @return boolean + * @return bool */ public function getHTML() { - return $this->HTML; + return $this->HTML; } /** - * @param boolean $HTML + * @param bool $HTML + * * @return Review */ public function setHTML($HTML) { - $this->HTML = $HTML; - return $this; - } + $this->HTML = $HTML; + return $this; + } } diff --git a/src/AppBundle/Client/Brickset/Entity/Set.php b/src/AppBundle/Client/Brickset/Entity/Set.php index 8e37519..aad7358 100644 --- a/src/AppBundle/Client/Brickset/Entity/Set.php +++ b/src/AppBundle/Client/Brickset/Entity/Set.php @@ -5,239 +5,214 @@ namespace AppBundle\Client\Brickset\Entity; class Set { /** - * @var int $setID + * @var int */ protected $setID = null; /** - * @var string $number + * @var string */ protected $number = null; /** - * @var int $numberVariant + * @var int */ protected $numberVariant = null; /** - * @var string $name + * @var string */ protected $name = null; /** - * @var string $year + * @var string */ protected $year = null; /** - * @var string $theme + * @var string */ protected $theme = null; /** - * @var string $themeGroup + * @var string */ protected $themeGroup = null; /** - * @var string $subtheme + * @var string */ protected $subtheme = null; /** - * @var string $pieces + * @var string */ protected $pieces = null; /** - * @var string $minifigs + * @var string */ protected $minifigs = null; /** - * @var boolean $image + * @var bool */ protected $image = null; /** - * @var string $imageFilename + * @var string */ protected $imageFilename = null; /** - * @var string $thumbnailURL + * @var string */ protected $thumbnailURL = null; /** - * @var string $largeThumbnailURL + * @var string */ protected $largeThumbnailURL = null; /** - * @var string $imageURL + * @var string */ protected $imageURL = null; /** - * @var string $bricksetURL + * @var string */ protected $bricksetURL = null; /** - * @var boolean $released + * @var bool */ protected $released = null; /** - * @var boolean $owned + * @var bool */ protected $owned = null; /** - * @var boolean $wanted + * @var bool */ protected $wanted = null; /** - * @var int $qtyOwned + * @var int */ protected $qtyOwned = null; /** - * @var string $userNotes + * @var string */ protected $userNotes = null; /** - * @var int $ACMDataCount + * @var int */ protected $ACMDataCount = null; /** - * @var int $ownedByTotal + * @var int */ protected $ownedByTotal = null; /** - * @var int $wantedByTotal + * @var int */ protected $wantedByTotal = null; /** - * @var string $UKRetailPrice + * @var string */ protected $UKRetailPrice = null; /** - * @var string $USRetailPrice - */ - protected $USRetailPrice = null; - - /** - * @var string $CARetailPrice - */ - protected $CARetailPrice = null; - - /** - * @var string $EURetailPrice - */ - protected $EURetailPrice = null; - - /** - * @var string $USDateAddedToSAH - */ - protected $USDateAddedToSAH = null; - - /** - * @var string $USDateRemovedFromSAH - */ - protected $USDateRemovedFromSAH = null; - - /** - * @var float $rating + * @var float */ protected $rating = null; /** - * @var int $reviewCount + * @var int */ protected $reviewCount = null; /** - * @var string $packagingType + * @var string */ protected $packagingType = null; /** - * @var string $availability + * @var string */ protected $availability = null; /** - * @var int $instructionsCount + * @var int */ protected $instructionsCount = null; /** - * @var int $additionalImageCount + * @var int */ protected $additionalImageCount = null; /** - * @var string $EAN + * @var string */ protected $EAN = null; /** - * @var string $UPC + * @var string */ protected $UPC = null; /** - * @var string $description + * @var string */ protected $description = null; /** - * @var \DateTime $lastUpdated + * @var \DateTime */ protected $lastUpdated = null; /** - * @param int $setID - * @param int $numberVariant - * @param boolean $image - * @param boolean $released - * @param boolean $owned - * @param boolean $wanted - * @param int $qtyOwned - * @param int $ACMDataCount - * @param int $ownedByTotal - * @param int $wantedByTotal - * @param float $rating - * @param int $reviewCount - * @param int $instructionsCount - * @param int $additionalImageCount + * @param int $setID + * @param int $numberVariant + * @param bool $image + * @param bool $released + * @param bool $owned + * @param bool $wanted + * @param int $qtyOwned + * @param int $ACMDataCount + * @param int $ownedByTotal + * @param int $wantedByTotal + * @param float $rating + * @param int $reviewCount + * @param int $instructionsCount + * @param int $additionalImageCount * @param \DateTime $lastUpdated */ public function __construct($setID, $numberVariant, $image, $released, $owned, $wanted, $qtyOwned, $ACMDataCount, $ownedByTotal, $wantedByTotal, $rating, $reviewCount, $instructionsCount, $additionalImageCount, \DateTime $lastUpdated) { - $this->setID = $setID; - $this->numberVariant = $numberVariant; - $this->image = $image; - $this->released = $released; - $this->owned = $owned; - $this->wanted = $wanted; - $this->qtyOwned = $qtyOwned; - $this->ACMDataCount = $ACMDataCount; - $this->ownedByTotal = $ownedByTotal; - $this->wantedByTotal = $wantedByTotal; - $this->rating = $rating; - $this->reviewCount = $reviewCount; - $this->instructionsCount = $instructionsCount; - $this->additionalImageCount = $additionalImageCount; - $this->lastUpdated = $lastUpdated->format(\DateTime::ATOM); + $this->setID = $setID; + $this->numberVariant = $numberVariant; + $this->image = $image; + $this->released = $released; + $this->owned = $owned; + $this->wanted = $wanted; + $this->qtyOwned = $qtyOwned; + $this->ACMDataCount = $ACMDataCount; + $this->ownedByTotal = $ownedByTotal; + $this->wantedByTotal = $wantedByTotal; + $this->rating = $rating; + $this->reviewCount = $reviewCount; + $this->instructionsCount = $instructionsCount; + $this->additionalImageCount = $additionalImageCount; + $this->lastUpdated = $lastUpdated->format(\DateTime::ATOM); } /** @@ -245,17 +220,19 @@ class Set */ public function getSetID() { - return $this->setID; + return $this->setID; } /** * @param int $setID + * * @return Set */ public function setSetID($setID) { - $this->setID = $setID; - return $this; + $this->setID = $setID; + + return $this; } /** @@ -263,17 +240,19 @@ class Set */ public function getNumber() { - return $this->number; + return $this->number; } /** * @param string $number + * * @return Set */ public function setNumber($number) { - $this->number = $number; - return $this; + $this->number = $number; + + return $this; } /** @@ -281,17 +260,19 @@ class Set */ public function getNumberVariant() { - return $this->numberVariant; + return $this->numberVariant; } /** * @param int $numberVariant + * * @return Set */ public function setNumberVariant($numberVariant) { - $this->numberVariant = $numberVariant; - return $this; + $this->numberVariant = $numberVariant; + + return $this; } /** @@ -299,17 +280,19 @@ class Set */ public function getName() { - return $this->name; + return $this->name; } /** * @param string $name + * * @return Set */ public function setName($name) { - $this->name = $name; - return $this; + $this->name = $name; + + return $this; } /** @@ -317,17 +300,19 @@ class Set */ public function getYear() { - return $this->year; + return $this->year; } /** * @param string $year + * * @return Set */ public function setYear($year) { - $this->year = $year; - return $this; + $this->year = $year; + + return $this; } /** @@ -335,17 +320,19 @@ class Set */ public function getTheme() { - return $this->theme; + return $this->theme; } /** * @param string $theme + * * @return Set */ public function setTheme($theme) { - $this->theme = $theme; - return $this; + $this->theme = $theme; + + return $this; } /** @@ -353,17 +340,19 @@ class Set */ public function getThemeGroup() { - return $this->themeGroup; + return $this->themeGroup; } /** * @param string $themeGroup + * * @return Set */ public function setThemeGroup($themeGroup) { - $this->themeGroup = $themeGroup; - return $this; + $this->themeGroup = $themeGroup; + + return $this; } /** @@ -371,17 +360,19 @@ class Set */ public function getSubtheme() { - return $this->subtheme; + return $this->subtheme; } /** * @param string $subtheme + * * @return Set */ public function setSubtheme($subtheme) { - $this->subtheme = $subtheme; - return $this; + $this->subtheme = $subtheme; + + return $this; } /** @@ -389,17 +380,19 @@ class Set */ public function getPieces() { - return $this->pieces; + return $this->pieces; } /** * @param string $pieces + * * @return Set */ public function setPieces($pieces) { - $this->pieces = $pieces; - return $this; + $this->pieces = $pieces; + + return $this; } /** @@ -407,35 +400,39 @@ class Set */ public function getMinifigs() { - return $this->minifigs; + return $this->minifigs; } /** * @param string $minifigs + * * @return Set */ public function setMinifigs($minifigs) { - $this->minifigs = $minifigs; - return $this; + $this->minifigs = $minifigs; + + return $this; } /** - * @return boolean + * @return bool */ public function getImage() { - return $this->image; + return $this->image; } /** - * @param boolean $image + * @param bool $image + * * @return Set */ public function setImage($image) { - $this->image = $image; - return $this; + $this->image = $image; + + return $this; } /** @@ -443,17 +440,19 @@ class Set */ public function getImageFilename() { - return $this->imageFilename; + return $this->imageFilename; } /** * @param string $imageFilename + * * @return Set */ public function setImageFilename($imageFilename) { - $this->imageFilename = $imageFilename; - return $this; + $this->imageFilename = $imageFilename; + + return $this; } /** @@ -461,17 +460,19 @@ class Set */ public function getThumbnailURL() { - return $this->thumbnailURL; + return $this->thumbnailURL; } /** * @param string $thumbnailURL + * * @return Set */ public function setThumbnailURL($thumbnailURL) { - $this->thumbnailURL = $thumbnailURL; - return $this; + $this->thumbnailURL = $thumbnailURL; + + return $this; } /** @@ -479,17 +480,19 @@ class Set */ public function getLargeThumbnailURL() { - return $this->largeThumbnailURL; + return $this->largeThumbnailURL; } /** * @param string $largeThumbnailURL + * * @return Set */ public function setLargeThumbnailURL($largeThumbnailURL) { - $this->largeThumbnailURL = $largeThumbnailURL; - return $this; + $this->largeThumbnailURL = $largeThumbnailURL; + + return $this; } /** @@ -497,17 +500,19 @@ class Set */ public function getImageURL() { - return $this->imageURL; + return $this->imageURL; } /** * @param string $imageURL + * * @return Set */ public function setImageURL($imageURL) { - $this->imageURL = $imageURL; - return $this; + $this->imageURL = $imageURL; + + return $this; } /** @@ -515,71 +520,79 @@ class Set */ public function getBricksetURL() { - return $this->bricksetURL; + return $this->bricksetURL; } /** * @param string $bricksetURL + * * @return Set */ public function setBricksetURL($bricksetURL) { - $this->bricksetURL = $bricksetURL; - return $this; + $this->bricksetURL = $bricksetURL; + + return $this; } /** - * @return boolean + * @return bool */ public function getReleased() { - return $this->released; + return $this->released; } /** - * @param boolean $released + * @param bool $released + * * @return Set */ public function setReleased($released) { - $this->released = $released; - return $this; + $this->released = $released; + + return $this; } /** - * @return boolean + * @return bool */ public function getOwned() { - return $this->owned; + return $this->owned; } /** - * @param boolean $owned + * @param bool $owned + * * @return Set */ public function setOwned($owned) { - $this->owned = $owned; - return $this; + $this->owned = $owned; + + return $this; } /** - * @return boolean + * @return bool */ public function getWanted() { - return $this->wanted; + return $this->wanted; } /** - * @param boolean $wanted + * @param bool $wanted + * * @return Set */ public function setWanted($wanted) { - $this->wanted = $wanted; - return $this; + $this->wanted = $wanted; + + return $this; } /** @@ -587,17 +600,19 @@ class Set */ public function getQtyOwned() { - return $this->qtyOwned; + return $this->qtyOwned; } /** * @param int $qtyOwned + * * @return Set */ public function setQtyOwned($qtyOwned) { - $this->qtyOwned = $qtyOwned; - return $this; + $this->qtyOwned = $qtyOwned; + + return $this; } /** @@ -605,17 +620,19 @@ class Set */ public function getUserNotes() { - return $this->userNotes; + return $this->userNotes; } /** * @param string $userNotes + * * @return Set */ public function setUserNotes($userNotes) { - $this->userNotes = $userNotes; - return $this; + $this->userNotes = $userNotes; + + return $this; } /** @@ -623,17 +640,19 @@ class Set */ public function getACMDataCount() { - return $this->ACMDataCount; + return $this->ACMDataCount; } /** * @param int $ACMDataCount + * * @return Set */ public function setACMDataCount($ACMDataCount) { - $this->ACMDataCount = $ACMDataCount; - return $this; + $this->ACMDataCount = $ACMDataCount; + + return $this; } /** @@ -641,17 +660,19 @@ class Set */ public function getOwnedByTotal() { - return $this->ownedByTotal; + return $this->ownedByTotal; } /** * @param int $ownedByTotal + * * @return Set */ public function setOwnedByTotal($ownedByTotal) { - $this->ownedByTotal = $ownedByTotal; - return $this; + $this->ownedByTotal = $ownedByTotal; + + return $this; } /** @@ -659,125 +680,19 @@ class Set */ public function getWantedByTotal() { - return $this->wantedByTotal; + return $this->wantedByTotal; } /** * @param int $wantedByTotal + * * @return Set */ public function setWantedByTotal($wantedByTotal) { - $this->wantedByTotal = $wantedByTotal; - return $this; - } + $this->wantedByTotal = $wantedByTotal; - /** - * @return string - */ - public function getUKRetailPrice() - { - return $this->UKRetailPrice; - } - - /** - * @param string $UKRetailPrice - * @return Set - */ - public function setUKRetailPrice($UKRetailPrice) - { - $this->UKRetailPrice = $UKRetailPrice; - return $this; - } - - /** - * @return string - */ - public function getUSRetailPrice() - { - return $this->USRetailPrice; - } - - /** - * @param string $USRetailPrice - * @return Set - */ - public function setUSRetailPrice($USRetailPrice) - { - $this->USRetailPrice = $USRetailPrice; - return $this; - } - - /** - * @return string - */ - public function getCARetailPrice() - { - return $this->CARetailPrice; - } - - /** - * @param string $CARetailPrice - * @return Set - */ - public function setCARetailPrice($CARetailPrice) - { - $this->CARetailPrice = $CARetailPrice; - return $this; - } - - /** - * @return string - */ - public function getEURetailPrice() - { - return $this->EURetailPrice; - } - - /** - * @param string $EURetailPrice - * @return Set - */ - public function setEURetailPrice($EURetailPrice) - { - $this->EURetailPrice = $EURetailPrice; - return $this; - } - - /** - * @return string - */ - public function getUSDateAddedToSAH() - { - return $this->USDateAddedToSAH; - } - - /** - * @param string $USDateAddedToSAH - * @return Set - */ - public function setUSDateAddedToSAH($USDateAddedToSAH) - { - $this->USDateAddedToSAH = $USDateAddedToSAH; - return $this; - } - - /** - * @return string - */ - public function getUSDateRemovedFromSAH() - { - return $this->USDateRemovedFromSAH; - } - - /** - * @param string $USDateRemovedFromSAH - * @return Set - */ - public function setUSDateRemovedFromSAH($USDateRemovedFromSAH) - { - $this->USDateRemovedFromSAH = $USDateRemovedFromSAH; - return $this; + return $this; } /** @@ -785,17 +700,19 @@ class Set */ public function getRating() { - return $this->rating; + return $this->rating; } /** * @param float $rating + * * @return Set */ public function setRating($rating) { - $this->rating = $rating; - return $this; + $this->rating = $rating; + + return $this; } /** @@ -803,17 +720,19 @@ class Set */ public function getReviewCount() { - return $this->reviewCount; + return $this->reviewCount; } /** * @param int $reviewCount + * * @return Set */ public function setReviewCount($reviewCount) { - $this->reviewCount = $reviewCount; - return $this; + $this->reviewCount = $reviewCount; + + return $this; } /** @@ -821,17 +740,19 @@ class Set */ public function getPackagingType() { - return $this->packagingType; + return $this->packagingType; } /** * @param string $packagingType + * * @return Set */ public function setPackagingType($packagingType) { - $this->packagingType = $packagingType; - return $this; + $this->packagingType = $packagingType; + + return $this; } /** @@ -839,17 +760,19 @@ class Set */ public function getAvailability() { - return $this->availability; + return $this->availability; } /** * @param string $availability + * * @return Set */ public function setAvailability($availability) { - $this->availability = $availability; - return $this; + $this->availability = $availability; + + return $this; } /** @@ -857,17 +780,19 @@ class Set */ public function getInstructionsCount() { - return $this->instructionsCount; + return $this->instructionsCount; } /** * @param int $instructionsCount + * * @return Set */ public function setInstructionsCount($instructionsCount) { - $this->instructionsCount = $instructionsCount; - return $this; + $this->instructionsCount = $instructionsCount; + + return $this; } /** @@ -875,17 +800,19 @@ class Set */ public function getAdditionalImageCount() { - return $this->additionalImageCount; + return $this->additionalImageCount; } /** * @param int $additionalImageCount + * * @return Set */ public function setAdditionalImageCount($additionalImageCount) { - $this->additionalImageCount = $additionalImageCount; - return $this; + $this->additionalImageCount = $additionalImageCount; + + return $this; } /** @@ -893,17 +820,19 @@ class Set */ public function getEAN() { - return $this->EAN; + return $this->EAN; } /** * @param string $EAN + * * @return Set */ public function setEAN($EAN) { - $this->EAN = $EAN; - return $this; + $this->EAN = $EAN; + + return $this; } /** @@ -911,17 +840,19 @@ class Set */ public function getUPC() { - return $this->UPC; + return $this->UPC; } /** * @param string $UPC + * * @return Set */ public function setUPC($UPC) { - $this->UPC = $UPC; - return $this; + $this->UPC = $UPC; + + return $this; } /** @@ -929,17 +860,19 @@ class Set */ public function getDescription() { - return $this->description; + return $this->description; } /** * @param string $description + * * @return Set */ public function setDescription($description) { - $this->description = $description; - return $this; + $this->description = $description; + + return $this; } /** @@ -947,25 +880,26 @@ class Set */ public function getLastUpdated() { - if ($this->lastUpdated == null) { - return null; - } else { - try { - return new \DateTime($this->lastUpdated); - } catch (\Exception $e) { - return null; + if ($this->lastUpdated == null) { + return null; + } else { + try { + return new \DateTime($this->lastUpdated); + } catch (\Exception $e) { + return null; + } } - } } /** * @param \DateTime $lastUpdated + * * @return Set */ public function setLastUpdated(\DateTime $lastUpdated) { - $this->lastUpdated = $lastUpdated->format(\DateTime::ATOM); - return $this; - } + $this->lastUpdated = $lastUpdated->format(\DateTime::ATOM); + return $this; + } } diff --git a/src/AppBundle/Client/Brickset/Entity/Subtheme.php b/src/AppBundle/Client/Brickset/Entity/Subtheme.php new file mode 100644 index 0000000..d704b2e --- /dev/null +++ b/src/AppBundle/Client/Brickset/Entity/Subtheme.php @@ -0,0 +1,119 @@ +theme; + } + + /** + * @param mixed $theme + */ + public function setTheme($theme) + { + $this->theme = $theme; + } + + /** + * @return mixed + */ + public function getSetCount() + { + return $this->setCount; + } + + /** + * @param mixed $setCount + */ + public function setSetCount($setCount) + { + $this->setCount = $setCount; + } + + /** + * @return string + */ + public function getSubtheme() + { + return $this->subtheme; + } + + /** + * @param string $subtheme + */ + public function setSubtheme($subtheme) + { + $this->subtheme = $subtheme; + } + + /** + * @return mixed + */ + public function getYearFrom() + { + return $this->yearFrom; + } + + /** + * @param mixed $yearFrom + */ + public function setYearFrom($yearFrom) + { + $this->yearFrom = $yearFrom; + } + + /** + * @return mixed + */ + public function getYearTo() + { + return $this->yearTo; + } + + /** + * @param mixed $yearTo + */ + public function setYearTo($yearTo) + { + $this->yearTo = $yearTo; + } +} diff --git a/src/AppBundle/Client/Brickset/Entity/Theme.php b/src/AppBundle/Client/Brickset/Entity/Theme.php new file mode 100644 index 0000000..deb2a56 --- /dev/null +++ b/src/AppBundle/Client/Brickset/Entity/Theme.php @@ -0,0 +1,117 @@ +theme; + } + + /** + * @param mixed $theme + */ + public function setTheme($theme) + { + $this->theme = $theme; + } + + /** + * @return mixed + */ + public function getSetCount() + { + return $this->setCount; + } + + /** + * @param mixed $setCount + */ + public function setSetCount($setCount) + { + $this->setCount = $setCount; + } + + /** + * @return mixed + */ + public function getSubthemeCount() + { + return $this->subthemeCount; + } + + /** + * @param mixed $subthemeCount + */ + public function setSubthemeCount($subthemeCount) + { + $this->subthemeCount = $subthemeCount; + } + + /** + * @return mixed + */ + public function getYearFrom() + { + return $this->yearFrom; + } + + /** + * @param mixed $yearFrom + */ + public function setYearFrom($yearFrom) + { + $this->yearFrom = $yearFrom; + } + + /** + * @return mixed + */ + public function getYearTo() + { + return $this->yearTo; + } + + /** + * @param mixed $yearTo + */ + public function setYearTo($yearTo) + { + $this->yearTo = $yearTo; + } +} diff --git a/src/AppBundle/Client/Brickset/Entity/Year.php b/src/AppBundle/Client/Brickset/Entity/Year.php new file mode 100644 index 0000000..2241d89 --- /dev/null +++ b/src/AppBundle/Client/Brickset/Entity/Year.php @@ -0,0 +1,78 @@ +theme = $theme; + $this->year = $year; + $this->setCount = $setCount; + } + + /** + * @return mixed + */ + public function getTheme() + { + return $this->theme; + } + + /** + * @param mixed $theme + */ + public function setTheme($theme) + { + $this->theme = $theme; + } + + /** + * @return mixed + */ + public function getYear() + { + return $this->year; + } + + /** + * @param mixed $year + */ + public function setYear($year) + { + $this->year = $year; + } + + /** + * @return mixed + */ + public function getSetCount() + { + return $this->setCount; + } + + /** + * @param mixed $setCount + */ + public function setSetCount($setCount) + { + $this->setCount = $setCount; + } +}