Permalink
Browse files

fixed entities

  • Loading branch information...
theodorDiaconu authored and iampersistent committed Jan 22, 2013
1 parent cc055c4 commit 70a52a3967c353f26bad585fc77fd9e22c42a331
@@ -3,15 +3,18 @@
namespace ImmersiveLabs\Pricing\Entity;
use ImmersiveLabs\Pricing\Entity\Element\TotalValueElement;
+use Vespolina\Entity\Pricing\PricingElementInterface;
use Vespolina\Entity\Pricing\PricingSetInterface;
+use Doctrine\Common\Collections\ArrayCollection;
class PricingSet implements PricingSetInterface
{
+ protected $id;
protected $context;
- protected $elements;
protected $processed;
protected $processingState = self::PROCESSING_UNPROCESSED;
protected $returns;
+ protected $pricingElements;
const PROCESSING_UNPROCESSED = 0;
const PROCESSING_FINISHED = 1;
@@ -27,7 +30,13 @@ public function __construct(array $customReturns = array())
$this->processed[$return] = null;
}
- $this->addElement(new TotalValueElement());
+ $this->pricingElements = new ArrayCollection();
+ $this->pricingElements->add(new TotalValueElement());
+ }
+
+ public function getId()
+ {
+ return $this->id;
}
public function getDiscounts()
@@ -82,8 +91,8 @@ public function process($context = null)
$this->processingState = self::PROCESSING_FINISHED;
}
- public function addElement($value)
+ public function addElement(PricingElementInterface $element)
{
- $this->elements[] = $value;
+ $this->pricingElements->add($element);
}
}
@@ -1,5 +1,5 @@
ImmersiveLabs\Pricing\Entity\PricingElement:
- type: entity
+ type: mappedSuperclass
table: pricing_element
id:
@@ -20,3 +20,4 @@ ImmersiveLabs\Pricing\Entity\PricingElement:
type: string
nullable: true
name: "element_type"
+
@@ -8,7 +8,8 @@ ImmersiveLabs\Pricing\Entity\PricingSet:
generator: { strategy: AUTO }
fields:
- pricingElements:
+ processed:
type: array
+ processingState:
+ type: string
nullable: true
- name: "pricing_elements"

0 comments on commit 70a52a3

Please sign in to comment.