Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

move properties and methods from Cart to BaseOrder

  • Loading branch information...
commit 7bb7db14add47154c8b2086e88124c0988b7ea2d 1 parent 7a43444
@iampersistent iampersistent authored
View
74 lib/Vespolina/Entity/Order/BaseOrder.php
@@ -20,11 +20,25 @@
class BaseOrder implements OrderInterface
{
protected $attributes;
+ protected $channel;
+ protected $createdAt;
+ protected $fulfillment;
+ protected $expiresAt;
+ protected $id;
protected $items;
protected $name;
protected $owner;
+ protected $partner;
+ protected $payment;
+ protected $pricingSet;
protected $state;
protected $totalPrice;
+ protected $updatedAt;
+
+ public function getId()
+ {
+ return $this->id;
+ }
/**
* @inheritdoc
@@ -90,6 +104,22 @@ public function setAttributes(array $attributes)
/**
* @inheritdoc
*/
+ public function getCreatedAt()
+ {
+ return $this->createdAt;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function setCreatedAt(\DateTime $createdAt)
+ {
+ $this->createdAt = $createdAt;
+ }
+
+ /**
+ * @inheritdoc
+ */
public function isEmpty()
{
return empty($this->items);
@@ -168,6 +198,14 @@ public function getName()
/**
* @inheritdoc
*/
+ public function setOwner($owner)
+ {
+ $this->owner = $owner;
+ }
+
+ /**
+ * @inheritdoc
+ */
public function getOwner()
{
return $this->owner;
@@ -176,25 +214,33 @@ public function getOwner()
/**
* @inheritdoc
*/
- public function setState($state)
+ public function getPricing()
{
- $this->state = $state;
+ return $this->pricingSet;
}
/**
* @inheritdoc
*/
- public function getState()
+ public function setPricing($pricingSet)
{
- return $this->state;
+ $this->pricingSet = $pricingSet;
}
/**
* @inheritdoc
*/
- public function setOwner($owner)
+ public function setState($state)
{
- $this->owner = $owner;
+ $this->state = $state;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function getState()
+ {
+ return $this->state;
}
/**
@@ -212,4 +258,20 @@ public function getTotalPrice()
{
return $this->totalPrice;
}
+
+ /**
+ * @inheritdoc
+ */
+ public function getUpdatedAt()
+ {
+ return $this->updatedAt;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function setUpdatedAt(\DateTime $updatedAt)
+ {
+ $this->updatedAt = $updatedAt;
+ }
}
View
60 lib/Vespolina/Entity/Order/Cart.php
@@ -1,6 +1,6 @@
<?php
/**
- * (c) 2011-2012 Vespolina Project http://www.vespolina-project.org
+ * (c) 2011-2013 Vespolina Project http://www.vespolina-project.org
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
@@ -23,19 +23,9 @@ class Cart extends BaseOrder implements CartInterface
const STATE_CLOSED = 'closed'; //Closed after processing
const STATE_EXPIRED = 'expired'; //Unprocessed and expired
- protected $createdAt;
- protected $expiresAt;
protected $followUp;
- protected $id;
protected $name;
protected $paymentInstruction;
- protected $pricingSet;
- protected $updatedAt;
-
- public function getId()
- {
- return $this->id;
- }
/**
* @inheritdoc
@@ -103,54 +93,6 @@ public function setPrice($name, $price)
$this->prices[$name] = $price;
}
- /**
- * @inheritdoc
- */
- public function getPricing()
- {
- return $this->pricingSet;
- }
-
- /**
- * @inheritdoc
- */
- public function setPricing($pricingSet)
- {
- $this->pricingSet = $pricingSet;
- }
-
- /**
- * @inheritdoc
- */
- public function getCreatedAt()
- {
- return $this->createdAt;
- }
-
- /**
- * @inheritdoc
- */
- public function setCreatedAt(\DateTime $createdAt)
- {
- $this->createdAt = $createdAt;
- }
-
- /**
- * @inheritdoc
- */
- public function getUpdatedAt()
- {
- return $this->updatedAt;
- }
-
- /**
- * @inheritdoc
- */
- public function setUpdatedAt(\DateTime $updatedAt)
- {
- $this->updatedAt = $updatedAt;
- }
-
public function autoSetCreatedAt()
{
if (null === $this->createdAt) {
Please sign in to comment.
Something went wrong with that request. Please try again.