Skip to content

Commit

Permalink
Merge pull request #7 from gennadyx/master
Browse files Browse the repository at this point in the history
Add oldprice
  • Loading branch information
Bukashk0zzz committed Dec 27, 2017
2 parents ed7ca5a + 3c5e3a5 commit 73010b2
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 8 deletions.
26 changes: 26 additions & 0 deletions src/Model/Offer/AbstractOffer.php
Expand Up @@ -36,6 +36,11 @@ abstract class AbstractOffer implements OfferInterface
*/
private $price;

/**
* @var float
*/
private $oldPrice;

/**
* @var string
*/
Expand Down Expand Up @@ -194,6 +199,26 @@ public function setPrice($price)
return $this;
}

/**
* @return float
*/
public function getOldPrice()
{
return $this->oldPrice;
}

/**
* @param float $oldPrice
*
* @return $this
*/
public function setOldPrice($oldPrice)
{
$this->oldPrice = $oldPrice;

return $this;
}

/**
* @return string
*/
Expand Down Expand Up @@ -507,6 +532,7 @@ private function getHeaderOptions()
return [
'url' => $this->getUrl(),
'price' => $this->getPrice(),
'oldprice' => $this->getOldPrice(),
'currencyId' => $this->getCurrencyId(),
'categoryId' => $this->getCategoryId(),
'market_category' => $this->getMarketCategory(),
Expand Down
1 change: 1 addition & 0 deletions tests/AbstractGeneratorTest.php
Expand Up @@ -214,6 +214,7 @@ private function createOffers()
->setAvailable($this->faker->boolean)
->setUrl($this->faker->url)
->setPrice($this->faker->numberBetween(1, 9999))
->setOldPrice($this->faker->numberBetween(1, 9999))
->setCurrencyId('UAH')
->setCategoryId($id)
->setDelivery($this->faker->boolean)
Expand Down
3 changes: 2 additions & 1 deletion tests/dtd/ArtistTitle.dtd
Expand Up @@ -30,7 +30,7 @@
order-before CDATA #IMPLIED>

<!ELEMENT offers (offer+)>
<!ELEMENT offer (url?, buyurl?, price, wprice?, currencyId, xCategory?, categoryId+, market_category?,
<!ELEMENT offer (url?, buyurl?, price, oldprice?, wprice?, currencyId, xCategory?, categoryId+, market_category?,
picture*, store?, pickup?, delivery?, deliveryIncluded?, local_delivery_cost?, orderingTime?,
artist?, title, year?, media?, starring?, director?, originalName?, country?,
aliases?, additional*, description?, sales_notes?, promo?,
Expand Down Expand Up @@ -68,6 +68,7 @@

<!ELEMENT deliveryTime EMPTY>
<!ELEMENT price (#PCDATA)>
<!ELEMENT oldprice (#PCDATA)>
<!ELEMENT wprice (#PCDATA)>
<!ELEMENT currencyId (#PCDATA)>
<!ELEMENT categoryId (#PCDATA)>
Expand Down
3 changes: 2 additions & 1 deletion tests/dtd/Audiobook.dtd
Expand Up @@ -30,7 +30,7 @@
order-before CDATA #IMPLIED>

<!ELEMENT offers (offer+)>
<!ELEMENT offer (url?, buyurl?, price, wprice?, currencyId, xCategory?, categoryId+, market_category?,
<!ELEMENT offer (url?, buyurl?, price, oldprice?, wprice?, currencyId, xCategory?, categoryId+, market_category?,
picture*, store?, pickup?, delivery?, deliveryIncluded?, local_delivery_cost?, orderingTime?,
author?, name, publisher?, series?, year?, ISBN?, volume?, part?, language?, table_of_contents?, performed_by?, performance_type?, storage?, format?, recording_length?,
aliases?, additional*, description?, sales_notes?, promo?,
Expand Down Expand Up @@ -68,6 +68,7 @@

<!ELEMENT deliveryTime EMPTY>
<!ELEMENT price (#PCDATA)>
<!ELEMENT oldprice (#PCDATA)>
<!ELEMENT wprice (#PCDATA)>
<!ELEMENT currencyId (#PCDATA)>
<!ELEMENT categoryId (#PCDATA)>
Expand Down
3 changes: 2 additions & 1 deletion tests/dtd/Book.dtd
Expand Up @@ -30,7 +30,7 @@
order-before CDATA #IMPLIED>

<!ELEMENT offers (offer+)>
<!ELEMENT offer (url?, buyurl?, price, wprice?, currencyId, xCategory?, categoryId+, market_category?,
<!ELEMENT offer (url?, buyurl?, price, oldprice?, wprice?, currencyId, xCategory?, categoryId+, market_category?,
picture*, store?, pickup?, delivery?, deliveryIncluded?, local_delivery_cost?, orderingTime?,
author?, name, publisher?, series?, year?, ISBN?, volume?, part?, language?, binding?, page_extent?, table_of_contents?,
aliases?, additional*, description?, sales_notes?, promo?,
Expand Down Expand Up @@ -68,6 +68,7 @@

<!ELEMENT deliveryTime EMPTY>
<!ELEMENT price (#PCDATA)>
<!ELEMENT oldprice (#PCDATA)>
<!ELEMENT wprice (#PCDATA)>
<!ELEMENT currencyId (#PCDATA)>
<!ELEMENT categoryId (#PCDATA)>
Expand Down
3 changes: 2 additions & 1 deletion tests/dtd/Custom.dtd
Expand Up @@ -30,7 +30,7 @@
order-before CDATA #IMPLIED>

<!ELEMENT offers (offer+)>
<!ELEMENT offer (url?, buyurl?, price, wprice?, currencyId, xCategory?, categoryId+, market_category?,
<!ELEMENT offer (url?, buyurl?, price, oldprice?, wprice?, currencyId, xCategory?, categoryId+, market_category?,
picture*, store?, pickup?, delivery?, deliveryIncluded?, local_delivery_cost?, orderingTime?,
typePrefix?, vendor, vendorCode?, model, (provider, tarifplan?)?,
aliases?, additional*, description?, sales_notes?, promo?,
Expand Down Expand Up @@ -68,6 +68,7 @@

<!ELEMENT deliveryTime EMPTY>
<!ELEMENT price (#PCDATA)>
<!ELEMENT oldprice (#PCDATA)>
<!ELEMENT wprice (#PCDATA)>
<!ELEMENT currencyId (#PCDATA)>
<!ELEMENT categoryId (#PCDATA)>
Expand Down
3 changes: 2 additions & 1 deletion tests/dtd/EventTicket.dtd
Expand Up @@ -30,7 +30,7 @@
order-before CDATA #IMPLIED>

<!ELEMENT offers (offer+)>
<!ELEMENT offer (url?, buyurl?, price, wprice?, currencyId, xCategory?, categoryId+, market_category?,
<!ELEMENT offer (url?, buyurl?, price, oldprice?, wprice?, currencyId, xCategory?, categoryId+, market_category?,
picture*, store?, pickup?, delivery?, deliveryIncluded?, local_delivery_cost?, orderingTime?,
name, place, hall?, hall_part?, date, is_premiere?, is_kids?,
aliases?, additional*, description?, sales_notes?, promo?,
Expand Down Expand Up @@ -68,6 +68,7 @@

<!ELEMENT deliveryTime EMPTY>
<!ELEMENT price (#PCDATA)>
<!ELEMENT oldprice (#PCDATA)>
<!ELEMENT wprice (#PCDATA)>
<!ELEMENT currencyId (#PCDATA)>
<!ELEMENT categoryId (#PCDATA)>
Expand Down
3 changes: 2 additions & 1 deletion tests/dtd/Original.dtd
Expand Up @@ -23,7 +23,7 @@
yid CDATA #IMPLIED>

<!ELEMENT offers (offer+)>
<!ELEMENT offer (url?, buyurl?, price, wprice?, currencyId, xCategory?, categoryId+, market_category?,
<!ELEMENT offer (url?, buyurl?, price, oldprice?, wprice?, currencyId, xCategory?, categoryId+, market_category?,
picture*, store?, pickup?, delivery?, deliveryIncluded?, local_delivery_cost?, orderingTime?,
((typePrefix?, vendor, vendorCode?, model, (provider, tarifplan?)?) |
(author?, name, publisher?, series?, year?, ISBN?, volume?, part?, language?, binding?, page_extent?, table_of_contents?) |
Expand Down Expand Up @@ -68,6 +68,7 @@

<!ELEMENT deliveryTime EMPTY>
<!ELEMENT price (#PCDATA)>
<!ELEMENT oldprice (#PCDATA)>
<!ELEMENT wprice (#PCDATA)>
<!ELEMENT currencyId (#PCDATA)>
<!ELEMENT categoryId (#PCDATA)>
Expand Down
3 changes: 2 additions & 1 deletion tests/dtd/Simple.dtd
Expand Up @@ -30,7 +30,7 @@
order-before CDATA #IMPLIED>

<!ELEMENT offers (offer+)>
<!ELEMENT offer (url?, buyurl?, price, wprice?, currencyId, xCategory?, categoryId+, market_category?,
<!ELEMENT offer (url?, buyurl?, price, oldprice?, wprice?, currencyId, xCategory?, categoryId+, market_category?,
picture*, store?, pickup?, delivery?, deliveryIncluded?, local_delivery_cost?, orderingTime?,
name, vendor?, vendorCode?,
aliases?, additional*, description?, sales_notes?, promo?,
Expand Down Expand Up @@ -68,6 +68,7 @@

<!ELEMENT deliveryTime EMPTY>
<!ELEMENT price (#PCDATA)>
<!ELEMENT oldprice (#PCDATA)>
<!ELEMENT wprice (#PCDATA)>
<!ELEMENT currencyId (#PCDATA)>
<!ELEMENT categoryId (#PCDATA)>
Expand Down
3 changes: 2 additions & 1 deletion tests/dtd/Tour.dtd
Expand Up @@ -30,7 +30,7 @@
order-before CDATA #IMPLIED>

<!ELEMENT offers (offer+)>
<!ELEMENT offer (url?, buyurl?, price, wprice?, currencyId, xCategory?, categoryId+, market_category?,
<!ELEMENT offer (url?, buyurl?, price, oldprice?, wprice?, currencyId, xCategory?, categoryId+, market_category?,
picture*, store?, pickup?, delivery?, deliveryIncluded?, local_delivery_cost?, orderingTime?,
worldRegion?, country?, region?, days, dataTour*, name, hotel_stars?, room?, meal?, included, transport, price_min?, price_max?, options?,
aliases?, additional*, description?, sales_notes?, promo?,
Expand Down Expand Up @@ -68,6 +68,7 @@

<!ELEMENT deliveryTime EMPTY>
<!ELEMENT price (#PCDATA)>
<!ELEMENT oldprice (#PCDATA)>
<!ELEMENT wprice (#PCDATA)>
<!ELEMENT currencyId (#PCDATA)>
<!ELEMENT categoryId (#PCDATA)>
Expand Down

0 comments on commit 73010b2

Please sign in to comment.