/**
  * Checks and repairs the internal consistency of the object.
  *
  * This method is executed after an already-instantiated object is re-hydrated
  * from the database.  It exists to check any foreign keys to make sure that
  * the objects related to the current object are correct based on foreign key.
  *
  * You can override this method in the stub class, but you should always invoke
  * the base method from the overridden method (i.e. parent::ensureConsistency()),
  * in case your model changes.
  *
  * @throws PropelException
  */
 public function ensureConsistency()
 {
     if ($this->aCategory !== null && $this->category_id !== $this->aCategory->getId()) {
         $this->aCategory = null;
     }
     if ($this->aAttribute !== null && $this->attribute_id !== $this->aAttribute->getId()) {
         $this->aAttribute = null;
     }
 }
 /**
  * Checks and repairs the internal consistency of the object.
  *
  * This method is executed after an already-instantiated object is re-hydrated
  * from the database.  It exists to check any foreign keys to make sure that
  * the objects related to the current object are correct based on foreign key.
  *
  * You can override this method in the stub class, but you should always invoke
  * the base method from the overridden method (i.e. parent::ensureConsistency()),
  * in case your model changes.
  *
  * @throws PropelException
  */
 public function ensureConsistency()
 {
     if ($this->aCartItem !== null && $this->cart_item_id !== $this->aCartItem->getId()) {
         $this->aCartItem = null;
     }
     if ($this->aAttribute !== null && $this->attribute_id !== $this->aAttribute->getId()) {
         $this->aAttribute = null;
     }
     if ($this->aAttributeAv !== null && $this->attribute_av_id !== $this->aAttributeAv->getId()) {
         $this->aAttributeAv = null;
     }
 }
예제 #3
0
 public function addAttribute(Attribute $attribute)
 {
     $this->attributes[$attribute->getId()] = $attribute;
 }