1
0
mirror of https://github.com/ToxicCrack/PrintABrick.git synced 2025-05-18 13:10:08 -07:00

Update Brickset client + Fix coding style

This commit is contained in:
David Hübner 2016-11-20 23:57:38 +01:00
parent a2e270de14
commit f2f4e086e6
8 changed files with 849 additions and 536 deletions

View File

@ -6,6 +6,9 @@ use AppBundle\Client\Brickset\Entity\AdditionalImage;
use AppBundle\Client\Brickset\Entity\Instructions; use AppBundle\Client\Brickset\Entity\Instructions;
use AppBundle\Client\Brickset\Entity\Review; use AppBundle\Client\Brickset\Entity\Review;
use AppBundle\Client\Brickset\Entity\Set; 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\Asset\Exception\LogicException;
use Symfony\Component\Debug\Exception\ContextErrorException; use Symfony\Component\Debug\Exception\ContextErrorException;
@ -24,6 +27,9 @@ class Brickset extends \SoapClient
'additionalImages' => AdditionalImage::class, 'additionalImages' => AdditionalImage::class,
'instructions' => Instructions::class, 'instructions' => Instructions::class,
'reviews' => Review::class, 'reviews' => Review::class,
'themes' => Theme::class,
'subthemes' => Subtheme::class,
'years' => Year::class,
); );
/** /**
@ -54,49 +60,46 @@ class Brickset extends \SoapClient
$this->apiKey = $apiKey; $this->apiKey = $apiKey;
} }
/** private function call($method, $parameters)
* @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)
{ {
$parameters = [ $parameters['apiKey'] = $this->apiKey;
'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,
];
try { try {
return $this->__soapCall('getSets', [$parameters])->getSetsResult->sets; return $this->__soapCall($method, [$parameters]);
} catch (ContextErrorException $e) {
return [];
} catch (\SoapFault $e) { } catch (\SoapFault $e) {
//TODO //TODO
throw new LogicException($e->getCode().' - '.$e->getMessage()); 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 * @param $SetID
* *
@ -104,110 +107,162 @@ class Brickset extends \SoapClient
*/ */
public function getSet($SetID) public function getSet($SetID)
{ {
$parameters = [ $parameters = ['userHash' => $this->userHash, 'SetID' => $SetID];
'apiKey' => $this->apiKey,
'userHash' => $this->userHash,
'SetID' => $SetID,
];
try { try {
return $this->__soapCall('getSet', [$parameters])->getSetResult->sets[0]; return $this->call('getSet', $parameters)->getSetResult->sets;
} catch (ContextErrorException $e) { } catch (ContextErrorException $e) {
return null; 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 * @param int $minutesAgo
* *
* @return Set[] * @return Set[]
*/ */
public function getRecentlyUpdatedSets($minutesAgo) public function getRecentlyUpdatedSets($minutesAgo)
{ {
$parameters = [ $parameters = ['minutesAgo' => $minutesAgo];
'apiKey' => $this->apiKey,
'minutesAgo' => $minutesAgo,
];
try { try {
return $this->__soapCall('getRecentlyUpdatedSets', [$parameters])->getRecentlyUpdatedSetsResult->sets; $response = $this->call('getRecentlyUpdatedSets', $parameters)->getRecentlyUpdatedSetsResult->sets;
return is_array($response) ? $response : [$response];
} catch (ContextErrorException $e) { } catch (ContextErrorException $e) {
return []; 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[] * @return AdditionalImage[]
*/ */
public function getAdditionalImages($setID) public function getAdditionalImages($setID)
{ {
$parameters = [ $parameters = ['setID' => $setID];
'apiKey' => $this->apiKey,
'setID' => $setID,
];
try { try {
return $this->__soapCall('getAdditionalImages', [$parameters])->getAdditionalImagesResult->additionalImages; $response = $this->call('getAdditionalImages', $parameters)->getAdditionalImagesResult->additionalImages;
return is_array($response) ? $response : [$response];
} catch (ContextErrorException $e) { } catch (ContextErrorException $e) {
return []; return [];
} catch (\SoapFault $e) {
//TODO
throw new LogicException($e->getCode().' - '.$e->getMessage());
} }
} }
/**
* Get the reviews for the specified set.
*
* @param int $setID Brickset unique id of set
*
* @return Review[]
*/
public function getReviews($setID) public function getReviews($setID)
{ {
$parameters = [ $parameters = ['setID' => $setID];
'apiKey' => $this->apiKey,
'setID' => $setID,
];
try { try {
return $this->__soapCall('getReviews', [$parameters])->getReviewsResult->reviews; $response = $this->call('getReviews', $parameters)->getReviewsResult->reviews;
return is_array($response) ? $response : [$response];
} catch (ContextErrorException $e) { } catch (ContextErrorException $e) {
return []; return [];
} catch (\SoapFault $e) {
//TODO
throw new LogicException($e->getCode().' - '.$e->getMessage());
} }
} }
/**
* Get a list of instructions for the specified set.
*
* @param int $setID Brickset unique id of set
*
* @return Instructions[]
*/
public function getInstructions($setID) public function getInstructions($setID)
{ {
$parameters = [ $parameters = ['setID' => $setID];
'apiKey' => $this->apiKey,
'setID' => $setID,
];
try { try {
return $this->__soapCall('getInstructions', [$parameters])->getInstructionsResult->instructions; $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) { } catch (ContextErrorException $e) {
return []; return [];
} catch (\SoapFault $e) {
//TODO
throw new LogicException($e->getCode().' - '.$e->getMessage());
} }
} }
public function login($username, $password) /**
* 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 = [ $parameters = ['theme' => $theme];
'apiKey' => $this->apiKey,
'username' => $username,
'password' => $password,
];
try { try {
$response = $this->__soapCall('login', [$parameters])->loginResult; $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') { if ($response == 'INVALIDKEY') {
return false; return false;
} elseif (strpos($response, 'ERROR:') === 0) { } elseif (strpos($response, 'ERROR:') === 0) {
@ -217,26 +272,15 @@ class Brickset extends \SoapClient
return true; return true;
} }
} catch (\SoapFault $e) {
//TODO
throw new LogicException($e->getCode().' - '.$e->getMessage());
}
} }
/** /**
* @return mixed * Check if an API key is valid.
*
* @return bool
*/ */
public function checkKey() public function checkKey()
{ {
$parameters = [ return ($this->call('checkKey', [])->checkKeyResult) == 'OK' ? true : false;
'apiKey' => $this->apiKey,
];
try {
return ($this->__soapCall('checkKey', [$parameters])->checkKeyResult) == 'OK' ? true : false;
} catch (\SoapFault $e) {
//TODO
throw new LogicException($e->getCode().' - '.$e->getMessage());
}
} }
} }

View File

@ -4,26 +4,23 @@ namespace AppBundle\Client\Brickset\Entity;
class AdditionalImage class AdditionalImage
{ {
/** /**
* @var string $thumbnailURL * @var string
*/ */
protected $thumbnailURL = null; protected $thumbnailURL = null;
/** /**
* @var string $largeThumbnailURL * @var string
*/ */
protected $largeThumbnailURL = null; protected $largeThumbnailURL = null;
/** /**
* @var string $imageURL * @var string
*/ */
protected $imageURL = null; protected $imageURL = null;
public function __construct() public function __construct()
{ {
} }
/** /**
@ -36,11 +33,13 @@ class AdditionalImage
/** /**
* @param string $thumbnailURL * @param string $thumbnailURL
*
* @return AdditionalImage * @return AdditionalImage
*/ */
public function setThumbnailURL($thumbnailURL) public function setThumbnailURL($thumbnailURL)
{ {
$this->thumbnailURL = $thumbnailURL; $this->thumbnailURL = $thumbnailURL;
return $this; return $this;
} }
@ -54,11 +53,13 @@ class AdditionalImage
/** /**
* @param string $largeThumbnailURL * @param string $largeThumbnailURL
*
* @return AdditionalImage * @return AdditionalImage
*/ */
public function setLargeThumbnailURL($largeThumbnailURL) public function setLargeThumbnailURL($largeThumbnailURL)
{ {
$this->largeThumbnailURL = $largeThumbnailURL; $this->largeThumbnailURL = $largeThumbnailURL;
return $this; return $this;
} }
@ -72,12 +73,13 @@ class AdditionalImage
/** /**
* @param string $imageURL * @param string $imageURL
*
* @return AdditionalImage * @return AdditionalImage
*/ */
public function setImageURL($imageURL) public function setImageURL($imageURL)
{ {
$this->imageURL = $imageURL; $this->imageURL = $imageURL;
return $this; return $this;
} }
} }

View File

@ -5,19 +5,17 @@ namespace AppBundle\Client\Brickset\Entity;
class Instructions class Instructions
{ {
/** /**
* @var string $URL * @var string
*/ */
protected $URL = null; protected $URL = null;
/** /**
* @var string $description * @var string
*/ */
protected $description = null; protected $description = null;
public function __construct() public function __construct()
{ {
} }
/** /**
@ -30,11 +28,13 @@ class Instructions
/** /**
* @param string $URL * @param string $URL
*
* @return Instructions * @return Instructions
*/ */
public function setURL($URL) public function setURL($URL)
{ {
$this->URL = $URL; $this->URL = $URL;
return $this; return $this;
} }
@ -48,12 +48,13 @@ class Instructions
/** /**
* @param string $description * @param string $description
*
* @return Instructions * @return Instructions
*/ */
public function setDescription($description) public function setDescription($description)
{ {
$this->description = $description; $this->description = $description;
return $this; return $this;
} }
} }

View File

@ -4,54 +4,53 @@ namespace AppBundle\Client\Brickset\Entity;
class Review class Review
{ {
/** /**
* @var string $author * @var string
*/ */
protected $author = null; protected $author = null;
/** /**
* @var \DateTime $datePosted * @var \DateTime
*/ */
protected $datePosted = null; protected $datePosted = null;
/** /**
* @var int $overallRating * @var int
*/ */
protected $overallRating = null; protected $overallRating = null;
/** /**
* @var int $parts * @var int
*/ */
protected $parts = null; protected $parts = null;
/** /**
* @var int $buildingExperience * @var int
*/ */
protected $buildingExperience = null; protected $buildingExperience = null;
/** /**
* @var int $playability * @var int
*/ */
protected $playability = null; protected $playability = null;
/** /**
* @var int $valueForMoney * @var int
*/ */
protected $valueForMoney = null; protected $valueForMoney = null;
/** /**
* @var string $title * @var string
*/ */
protected $title = null; protected $title = null;
/** /**
* @var string $review * @var string
*/ */
protected $review = null; protected $review = null;
/** /**
* @var boolean $HTML * @var bool
*/ */
protected $HTML = null; protected $HTML = null;
@ -62,7 +61,7 @@ class Review
* @param int $buildingExperience * @param int $buildingExperience
* @param int $playability * @param int $playability
* @param int $valueForMoney * @param int $valueForMoney
* @param boolean $HTML * @param bool $HTML
*/ */
public function __construct(\DateTime $datePosted, $overallRating, $parts, $buildingExperience, $playability, $valueForMoney, $HTML) public function __construct(\DateTime $datePosted, $overallRating, $parts, $buildingExperience, $playability, $valueForMoney, $HTML)
{ {
@ -85,11 +84,13 @@ class Review
/** /**
* @param string $author * @param string $author
*
* @return Review * @return Review
*/ */
public function setAuthor($author) public function setAuthor($author)
{ {
$this->author = $author; $this->author = $author;
return $this; return $this;
} }
@ -111,11 +112,13 @@ class Review
/** /**
* @param \DateTime $datePosted * @param \DateTime $datePosted
*
* @return Review * @return Review
*/ */
public function setDatePosted(\DateTime $datePosted) public function setDatePosted(\DateTime $datePosted)
{ {
$this->datePosted = $datePosted->format(\DateTime::ATOM); $this->datePosted = $datePosted->format(\DateTime::ATOM);
return $this; return $this;
} }
@ -129,11 +132,13 @@ class Review
/** /**
* @param int $overallRating * @param int $overallRating
*
* @return Review * @return Review
*/ */
public function setOverallRating($overallRating) public function setOverallRating($overallRating)
{ {
$this->overallRating = $overallRating; $this->overallRating = $overallRating;
return $this; return $this;
} }
@ -147,11 +152,13 @@ class Review
/** /**
* @param int $parts * @param int $parts
*
* @return Review * @return Review
*/ */
public function setParts($parts) public function setParts($parts)
{ {
$this->parts = $parts; $this->parts = $parts;
return $this; return $this;
} }
@ -165,11 +172,13 @@ class Review
/** /**
* @param int $buildingExperience * @param int $buildingExperience
*
* @return Review * @return Review
*/ */
public function setBuildingExperience($buildingExperience) public function setBuildingExperience($buildingExperience)
{ {
$this->buildingExperience = $buildingExperience; $this->buildingExperience = $buildingExperience;
return $this; return $this;
} }
@ -183,11 +192,13 @@ class Review
/** /**
* @param int $playability * @param int $playability
*
* @return Review * @return Review
*/ */
public function setPlayability($playability) public function setPlayability($playability)
{ {
$this->playability = $playability; $this->playability = $playability;
return $this; return $this;
} }
@ -201,11 +212,13 @@ class Review
/** /**
* @param int $valueForMoney * @param int $valueForMoney
*
* @return Review * @return Review
*/ */
public function setValueForMoney($valueForMoney) public function setValueForMoney($valueForMoney)
{ {
$this->valueForMoney = $valueForMoney; $this->valueForMoney = $valueForMoney;
return $this; return $this;
} }
@ -219,11 +232,13 @@ class Review
/** /**
* @param string $title * @param string $title
*
* @return Review * @return Review
*/ */
public function setTitle($title) public function setTitle($title)
{ {
$this->title = $title; $this->title = $title;
return $this; return $this;
} }
@ -237,16 +252,18 @@ class Review
/** /**
* @param string $review * @param string $review
*
* @return Review * @return Review
*/ */
public function setReview($review) public function setReview($review)
{ {
$this->review = $review; $this->review = $review;
return $this; return $this;
} }
/** /**
* @return boolean * @return bool
*/ */
public function getHTML() public function getHTML()
{ {
@ -254,13 +271,14 @@ class Review
} }
/** /**
* @param boolean $HTML * @param bool $HTML
*
* @return Review * @return Review
*/ */
public function setHTML($HTML) public function setHTML($HTML)
{ {
$this->HTML = $HTML; $this->HTML = $HTML;
return $this; return $this;
} }
} }

View File

@ -5,212 +5,187 @@ namespace AppBundle\Client\Brickset\Entity;
class Set class Set
{ {
/** /**
* @var int $setID * @var int
*/ */
protected $setID = null; protected $setID = null;
/** /**
* @var string $number * @var string
*/ */
protected $number = null; protected $number = null;
/** /**
* @var int $numberVariant * @var int
*/ */
protected $numberVariant = null; protected $numberVariant = null;
/** /**
* @var string $name * @var string
*/ */
protected $name = null; protected $name = null;
/** /**
* @var string $year * @var string
*/ */
protected $year = null; protected $year = null;
/** /**
* @var string $theme * @var string
*/ */
protected $theme = null; protected $theme = null;
/** /**
* @var string $themeGroup * @var string
*/ */
protected $themeGroup = null; protected $themeGroup = null;
/** /**
* @var string $subtheme * @var string
*/ */
protected $subtheme = null; protected $subtheme = null;
/** /**
* @var string $pieces * @var string
*/ */
protected $pieces = null; protected $pieces = null;
/** /**
* @var string $minifigs * @var string
*/ */
protected $minifigs = null; protected $minifigs = null;
/** /**
* @var boolean $image * @var bool
*/ */
protected $image = null; protected $image = null;
/** /**
* @var string $imageFilename * @var string
*/ */
protected $imageFilename = null; protected $imageFilename = null;
/** /**
* @var string $thumbnailURL * @var string
*/ */
protected $thumbnailURL = null; protected $thumbnailURL = null;
/** /**
* @var string $largeThumbnailURL * @var string
*/ */
protected $largeThumbnailURL = null; protected $largeThumbnailURL = null;
/** /**
* @var string $imageURL * @var string
*/ */
protected $imageURL = null; protected $imageURL = null;
/** /**
* @var string $bricksetURL * @var string
*/ */
protected $bricksetURL = null; protected $bricksetURL = null;
/** /**
* @var boolean $released * @var bool
*/ */
protected $released = null; protected $released = null;
/** /**
* @var boolean $owned * @var bool
*/ */
protected $owned = null; protected $owned = null;
/** /**
* @var boolean $wanted * @var bool
*/ */
protected $wanted = null; protected $wanted = null;
/** /**
* @var int $qtyOwned * @var int
*/ */
protected $qtyOwned = null; protected $qtyOwned = null;
/** /**
* @var string $userNotes * @var string
*/ */
protected $userNotes = null; protected $userNotes = null;
/** /**
* @var int $ACMDataCount * @var int
*/ */
protected $ACMDataCount = null; protected $ACMDataCount = null;
/** /**
* @var int $ownedByTotal * @var int
*/ */
protected $ownedByTotal = null; protected $ownedByTotal = null;
/** /**
* @var int $wantedByTotal * @var int
*/ */
protected $wantedByTotal = null; protected $wantedByTotal = null;
/** /**
* @var string $UKRetailPrice * @var string
*/ */
protected $UKRetailPrice = null; protected $UKRetailPrice = null;
/** /**
* @var string $USRetailPrice * @var float
*/
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
*/ */
protected $rating = null; protected $rating = null;
/** /**
* @var int $reviewCount * @var int
*/ */
protected $reviewCount = null; protected $reviewCount = null;
/** /**
* @var string $packagingType * @var string
*/ */
protected $packagingType = null; protected $packagingType = null;
/** /**
* @var string $availability * @var string
*/ */
protected $availability = null; protected $availability = null;
/** /**
* @var int $instructionsCount * @var int
*/ */
protected $instructionsCount = null; protected $instructionsCount = null;
/** /**
* @var int $additionalImageCount * @var int
*/ */
protected $additionalImageCount = null; protected $additionalImageCount = null;
/** /**
* @var string $EAN * @var string
*/ */
protected $EAN = null; protected $EAN = null;
/** /**
* @var string $UPC * @var string
*/ */
protected $UPC = null; protected $UPC = null;
/** /**
* @var string $description * @var string
*/ */
protected $description = null; protected $description = null;
/** /**
* @var \DateTime $lastUpdated * @var \DateTime
*/ */
protected $lastUpdated = null; protected $lastUpdated = null;
/** /**
* @param int $setID * @param int $setID
* @param int $numberVariant * @param int $numberVariant
* @param boolean $image * @param bool $image
* @param boolean $released * @param bool $released
* @param boolean $owned * @param bool $owned
* @param boolean $wanted * @param bool $wanted
* @param int $qtyOwned * @param int $qtyOwned
* @param int $ACMDataCount * @param int $ACMDataCount
* @param int $ownedByTotal * @param int $ownedByTotal
@ -250,11 +225,13 @@ class Set
/** /**
* @param int $setID * @param int $setID
*
* @return Set * @return Set
*/ */
public function setSetID($setID) public function setSetID($setID)
{ {
$this->setID = $setID; $this->setID = $setID;
return $this; return $this;
} }
@ -268,11 +245,13 @@ class Set
/** /**
* @param string $number * @param string $number
*
* @return Set * @return Set
*/ */
public function setNumber($number) public function setNumber($number)
{ {
$this->number = $number; $this->number = $number;
return $this; return $this;
} }
@ -286,11 +265,13 @@ class Set
/** /**
* @param int $numberVariant * @param int $numberVariant
*
* @return Set * @return Set
*/ */
public function setNumberVariant($numberVariant) public function setNumberVariant($numberVariant)
{ {
$this->numberVariant = $numberVariant; $this->numberVariant = $numberVariant;
return $this; return $this;
} }
@ -304,11 +285,13 @@ class Set
/** /**
* @param string $name * @param string $name
*
* @return Set * @return Set
*/ */
public function setName($name) public function setName($name)
{ {
$this->name = $name; $this->name = $name;
return $this; return $this;
} }
@ -322,11 +305,13 @@ class Set
/** /**
* @param string $year * @param string $year
*
* @return Set * @return Set
*/ */
public function setYear($year) public function setYear($year)
{ {
$this->year = $year; $this->year = $year;
return $this; return $this;
} }
@ -340,11 +325,13 @@ class Set
/** /**
* @param string $theme * @param string $theme
*
* @return Set * @return Set
*/ */
public function setTheme($theme) public function setTheme($theme)
{ {
$this->theme = $theme; $this->theme = $theme;
return $this; return $this;
} }
@ -358,11 +345,13 @@ class Set
/** /**
* @param string $themeGroup * @param string $themeGroup
*
* @return Set * @return Set
*/ */
public function setThemeGroup($themeGroup) public function setThemeGroup($themeGroup)
{ {
$this->themeGroup = $themeGroup; $this->themeGroup = $themeGroup;
return $this; return $this;
} }
@ -376,11 +365,13 @@ class Set
/** /**
* @param string $subtheme * @param string $subtheme
*
* @return Set * @return Set
*/ */
public function setSubtheme($subtheme) public function setSubtheme($subtheme)
{ {
$this->subtheme = $subtheme; $this->subtheme = $subtheme;
return $this; return $this;
} }
@ -394,11 +385,13 @@ class Set
/** /**
* @param string $pieces * @param string $pieces
*
* @return Set * @return Set
*/ */
public function setPieces($pieces) public function setPieces($pieces)
{ {
$this->pieces = $pieces; $this->pieces = $pieces;
return $this; return $this;
} }
@ -412,16 +405,18 @@ class Set
/** /**
* @param string $minifigs * @param string $minifigs
*
* @return Set * @return Set
*/ */
public function setMinifigs($minifigs) public function setMinifigs($minifigs)
{ {
$this->minifigs = $minifigs; $this->minifigs = $minifigs;
return $this; return $this;
} }
/** /**
* @return boolean * @return bool
*/ */
public function getImage() public function getImage()
{ {
@ -429,12 +424,14 @@ class Set
} }
/** /**
* @param boolean $image * @param bool $image
*
* @return Set * @return Set
*/ */
public function setImage($image) public function setImage($image)
{ {
$this->image = $image; $this->image = $image;
return $this; return $this;
} }
@ -448,11 +445,13 @@ class Set
/** /**
* @param string $imageFilename * @param string $imageFilename
*
* @return Set * @return Set
*/ */
public function setImageFilename($imageFilename) public function setImageFilename($imageFilename)
{ {
$this->imageFilename = $imageFilename; $this->imageFilename = $imageFilename;
return $this; return $this;
} }
@ -466,11 +465,13 @@ class Set
/** /**
* @param string $thumbnailURL * @param string $thumbnailURL
*
* @return Set * @return Set
*/ */
public function setThumbnailURL($thumbnailURL) public function setThumbnailURL($thumbnailURL)
{ {
$this->thumbnailURL = $thumbnailURL; $this->thumbnailURL = $thumbnailURL;
return $this; return $this;
} }
@ -484,11 +485,13 @@ class Set
/** /**
* @param string $largeThumbnailURL * @param string $largeThumbnailURL
*
* @return Set * @return Set
*/ */
public function setLargeThumbnailURL($largeThumbnailURL) public function setLargeThumbnailURL($largeThumbnailURL)
{ {
$this->largeThumbnailURL = $largeThumbnailURL; $this->largeThumbnailURL = $largeThumbnailURL;
return $this; return $this;
} }
@ -502,11 +505,13 @@ class Set
/** /**
* @param string $imageURL * @param string $imageURL
*
* @return Set * @return Set
*/ */
public function setImageURL($imageURL) public function setImageURL($imageURL)
{ {
$this->imageURL = $imageURL; $this->imageURL = $imageURL;
return $this; return $this;
} }
@ -520,16 +525,18 @@ class Set
/** /**
* @param string $bricksetURL * @param string $bricksetURL
*
* @return Set * @return Set
*/ */
public function setBricksetURL($bricksetURL) public function setBricksetURL($bricksetURL)
{ {
$this->bricksetURL = $bricksetURL; $this->bricksetURL = $bricksetURL;
return $this; return $this;
} }
/** /**
* @return boolean * @return bool
*/ */
public function getReleased() public function getReleased()
{ {
@ -537,17 +544,19 @@ class Set
} }
/** /**
* @param boolean $released * @param bool $released
*
* @return Set * @return Set
*/ */
public function setReleased($released) public function setReleased($released)
{ {
$this->released = $released; $this->released = $released;
return $this; return $this;
} }
/** /**
* @return boolean * @return bool
*/ */
public function getOwned() public function getOwned()
{ {
@ -555,17 +564,19 @@ class Set
} }
/** /**
* @param boolean $owned * @param bool $owned
*
* @return Set * @return Set
*/ */
public function setOwned($owned) public function setOwned($owned)
{ {
$this->owned = $owned; $this->owned = $owned;
return $this; return $this;
} }
/** /**
* @return boolean * @return bool
*/ */
public function getWanted() public function getWanted()
{ {
@ -573,12 +584,14 @@ class Set
} }
/** /**
* @param boolean $wanted * @param bool $wanted
*
* @return Set * @return Set
*/ */
public function setWanted($wanted) public function setWanted($wanted)
{ {
$this->wanted = $wanted; $this->wanted = $wanted;
return $this; return $this;
} }
@ -592,11 +605,13 @@ class Set
/** /**
* @param int $qtyOwned * @param int $qtyOwned
*
* @return Set * @return Set
*/ */
public function setQtyOwned($qtyOwned) public function setQtyOwned($qtyOwned)
{ {
$this->qtyOwned = $qtyOwned; $this->qtyOwned = $qtyOwned;
return $this; return $this;
} }
@ -610,11 +625,13 @@ class Set
/** /**
* @param string $userNotes * @param string $userNotes
*
* @return Set * @return Set
*/ */
public function setUserNotes($userNotes) public function setUserNotes($userNotes)
{ {
$this->userNotes = $userNotes; $this->userNotes = $userNotes;
return $this; return $this;
} }
@ -628,11 +645,13 @@ class Set
/** /**
* @param int $ACMDataCount * @param int $ACMDataCount
*
* @return Set * @return Set
*/ */
public function setACMDataCount($ACMDataCount) public function setACMDataCount($ACMDataCount)
{ {
$this->ACMDataCount = $ACMDataCount; $this->ACMDataCount = $ACMDataCount;
return $this; return $this;
} }
@ -646,11 +665,13 @@ class Set
/** /**
* @param int $ownedByTotal * @param int $ownedByTotal
*
* @return Set * @return Set
*/ */
public function setOwnedByTotal($ownedByTotal) public function setOwnedByTotal($ownedByTotal)
{ {
$this->ownedByTotal = $ownedByTotal; $this->ownedByTotal = $ownedByTotal;
return $this; return $this;
} }
@ -664,119 +685,13 @@ class Set
/** /**
* @param int $wantedByTotal * @param int $wantedByTotal
*
* @return Set * @return Set
*/ */
public function setWantedByTotal($wantedByTotal) public function setWantedByTotal($wantedByTotal)
{ {
$this->wantedByTotal = $wantedByTotal; $this->wantedByTotal = $wantedByTotal;
return $this;
}
/**
* @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;
} }
@ -790,11 +705,13 @@ class Set
/** /**
* @param float $rating * @param float $rating
*
* @return Set * @return Set
*/ */
public function setRating($rating) public function setRating($rating)
{ {
$this->rating = $rating; $this->rating = $rating;
return $this; return $this;
} }
@ -808,11 +725,13 @@ class Set
/** /**
* @param int $reviewCount * @param int $reviewCount
*
* @return Set * @return Set
*/ */
public function setReviewCount($reviewCount) public function setReviewCount($reviewCount)
{ {
$this->reviewCount = $reviewCount; $this->reviewCount = $reviewCount;
return $this; return $this;
} }
@ -826,11 +745,13 @@ class Set
/** /**
* @param string $packagingType * @param string $packagingType
*
* @return Set * @return Set
*/ */
public function setPackagingType($packagingType) public function setPackagingType($packagingType)
{ {
$this->packagingType = $packagingType; $this->packagingType = $packagingType;
return $this; return $this;
} }
@ -844,11 +765,13 @@ class Set
/** /**
* @param string $availability * @param string $availability
*
* @return Set * @return Set
*/ */
public function setAvailability($availability) public function setAvailability($availability)
{ {
$this->availability = $availability; $this->availability = $availability;
return $this; return $this;
} }
@ -862,11 +785,13 @@ class Set
/** /**
* @param int $instructionsCount * @param int $instructionsCount
*
* @return Set * @return Set
*/ */
public function setInstructionsCount($instructionsCount) public function setInstructionsCount($instructionsCount)
{ {
$this->instructionsCount = $instructionsCount; $this->instructionsCount = $instructionsCount;
return $this; return $this;
} }
@ -880,11 +805,13 @@ class Set
/** /**
* @param int $additionalImageCount * @param int $additionalImageCount
*
* @return Set * @return Set
*/ */
public function setAdditionalImageCount($additionalImageCount) public function setAdditionalImageCount($additionalImageCount)
{ {
$this->additionalImageCount = $additionalImageCount; $this->additionalImageCount = $additionalImageCount;
return $this; return $this;
} }
@ -898,11 +825,13 @@ class Set
/** /**
* @param string $EAN * @param string $EAN
*
* @return Set * @return Set
*/ */
public function setEAN($EAN) public function setEAN($EAN)
{ {
$this->EAN = $EAN; $this->EAN = $EAN;
return $this; return $this;
} }
@ -916,11 +845,13 @@ class Set
/** /**
* @param string $UPC * @param string $UPC
*
* @return Set * @return Set
*/ */
public function setUPC($UPC) public function setUPC($UPC)
{ {
$this->UPC = $UPC; $this->UPC = $UPC;
return $this; return $this;
} }
@ -934,11 +865,13 @@ class Set
/** /**
* @param string $description * @param string $description
*
* @return Set * @return Set
*/ */
public function setDescription($description) public function setDescription($description)
{ {
$this->description = $description; $this->description = $description;
return $this; return $this;
} }
@ -960,12 +893,13 @@ class Set
/** /**
* @param \DateTime $lastUpdated * @param \DateTime $lastUpdated
*
* @return Set * @return Set
*/ */
public function setLastUpdated(\DateTime $lastUpdated) public function setLastUpdated(\DateTime $lastUpdated)
{ {
$this->lastUpdated = $lastUpdated->format(\DateTime::ATOM); $this->lastUpdated = $lastUpdated->format(\DateTime::ATOM);
return $this; return $this;
} }
} }

View File

@ -0,0 +1,119 @@
<?php
/**
* Created by PhpStorm.
* User: hubnedav
* Date: 11/11/16
* Time: 7:13 PM.
*/
namespace AppBundle\Client\Brickset\Entity;
class Subtheme
{
/**
* @var string
*/
protected $theme;
/**
* @var string
*/
protected $subtheme;
/**
* @var
*/
protected $setCount;
/**
* @var int
*/
protected $yearFrom;
/**
* @var int
*/
protected $yearTo;
public function __construct()
{
}
/**
* @return mixed
*/
public function getTheme()
{
return $this->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;
}
}

View File

@ -0,0 +1,117 @@
<?php
/**
* Created by PhpStorm.
* User: hubnedav
* Date: 11/11/16
* Time: 7:13 PM.
*/
namespace AppBundle\Client\Brickset\Entity;
class Theme
{
/**
* @var string
*/
protected $theme;
/**
* @var int
*/
protected $setCount;
/**
* @var int
*/
protected $subthemeCount;
/**
* @var int
*/
protected $yearFrom;
/**
* @var int
*/
protected $yearTo;
public function __construct()
{
}
/**
* @return mixed
*/
public function getTheme()
{
return $this->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;
}
}

View File

@ -0,0 +1,78 @@
<?php
/**
* Created by PhpStorm.
* User: hubnedav
* Date: 11/20/16
* Time: 11:17 PM.
*/
namespace AppBundle\Client\Brickset\Entity;
class Year
{
protected $theme;
protected $year;
protected $setCount;
/**
* Year constructor.
*
* @param $theme
* @param $year
* @param $setCount
*/
public function __construct($theme, $year, $setCount)
{
$this->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;
}
}