/**
  * @param AttributeAvModel $attributeAv
  * @depends testUpdate
  */
 public function testDelete(AttributeAvModel $attributeAv)
 {
     $event = new AttributeAvDeleteEvent($attributeAv->getId());
     $action = new AttributeAv();
     $action->delete($event, null, $this->getMockEventDispatcher());
     $deletedAttributeAv = $event->getAttributeAv();
     $this->assertInstanceOf('Thelia\\Model\\AttributeAv', $deletedAttributeAv);
     $this->assertTrue($deletedAttributeAv->isDeleted());
 }
Exemple #2
0
 /**
  * @depends testUpdate
  */
 public function testDelete(AttributeAvModel $attributeAv)
 {
     $event = new AttributeAvDeleteEvent($attributeAv->getId());
     $event->setDispatcher($this->getMock("Symfony\\Component\\EventDispatcher\\EventDispatcherInterface"));
     $action = new AttributeAv();
     $action->delete($event);
     $deletedAttributeAv = $event->getAttributeAv();
     $this->assertInstanceOf('Thelia\\Model\\AttributeAv', $deletedAttributeAv);
     $this->assertTrue($deletedAttributeAv->isDeleted());
 }
 /**
  * Filter the query by a related \Thelia\Model\AttributeAv object
  *
  * @param \Thelia\Model\AttributeAv|ObjectCollection $attributeAv The related object(s) to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildAttributeAvI18nQuery The current query, for fluid interface
  */
 public function filterByAttributeAv($attributeAv, $comparison = null)
 {
     if ($attributeAv instanceof \Thelia\Model\AttributeAv) {
         return $this->addUsingAlias(AttributeAvI18nTableMap::ID, $attributeAv->getId(), $comparison);
     } elseif ($attributeAv instanceof ObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(AttributeAvI18nTableMap::ID, $attributeAv->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByAttributeAv() only accepts arguments of type \\Thelia\\Model\\AttributeAv or Collection');
     }
 }
 /**
  * Declares an association between this object and a ChildAttributeAv object.
  *
  * @param                  ChildAttributeAv $v
  * @return                 \Thelia\Model\AttributeCombination The current object (for fluent API support)
  * @throws PropelException
  */
 public function setAttributeAv(ChildAttributeAv $v = null)
 {
     if ($v === null) {
         $this->setAttributeAvId(NULL);
     } else {
         $this->setAttributeAvId($v->getId());
     }
     $this->aAttributeAv = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the ChildAttributeAv object, it will not be re-added.
     if ($v !== null) {
         $v->addAttributeCombination($this);
     }
     return $this;
 }
Exemple #5
0
 /**
  * Create a new attribute entry
  *
  * @param AttributeAvCreateEvent $event
  */
 public function create(AttributeAvCreateEvent $event)
 {
     $attribute = new AttributeAvModel();
     $attribute->setDispatcher($event->getDispatcher())->setAttributeId($event->getAttributeId())->setLocale($event->getLocale())->setTitle($event->getTitle())->save();
     $event->setAttributeAv($attribute);
 }
 /**
  * @param AttributeAv $object
  * @return int
  */
 protected function getObjectId($object)
 {
     return $object->getId();
 }
 /**
  * Create a new attribute entry
  *
  * @param AttributeAvCreateEvent $event
  * @param $eventName
  * @param EventDispatcherInterface $dispatcher
  */
 public function create(AttributeAvCreateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
 {
     $attribute = new AttributeAvModel();
     $attribute->setDispatcher($dispatcher)->setAttributeId($event->getAttributeId())->setLocale($event->getLocale())->setTitle($event->getTitle())->save();
     $event->setAttributeAv($attribute);
 }
Exemple #8
0
 /**
  * Filter the query by a related \Thelia\Model\AttributeAv object
  *
  * @param \Thelia\Model\AttributeAv|ObjectCollection $attributeAv  the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildAttributeQuery The current query, for fluid interface
  */
 public function filterByAttributeAv($attributeAv, $comparison = null)
 {
     if ($attributeAv instanceof \Thelia\Model\AttributeAv) {
         return $this->addUsingAlias(AttributeTableMap::ID, $attributeAv->getAttributeId(), $comparison);
     } elseif ($attributeAv instanceof ObjectCollection) {
         return $this->useAttributeAvQuery()->filterByPrimaryKeys($attributeAv->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByAttributeAv() only accepts arguments of type \\Thelia\\Model\\AttributeAv or Collection');
     }
 }
Exemple #9
0
 /**
  * Exclude object from result
  *
  * @param   ChildAttributeAv $attributeAv Object to remove from the list of results
  *
  * @return ChildAttributeAvQuery The current query, for fluid interface
  */
 public function prune($attributeAv = null)
 {
     if ($attributeAv) {
         $this->addUsingAlias(AttributeAvTableMap::ID, $attributeAv->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }