Exemplo n.º 1
0
 /**
  * @param FeatureAvModel $featureAv
  * @depends testUpdate
  */
 public function testDelete(FeatureAvModel $featureAv)
 {
     $event = new FeatureAvDeleteEvent($featureAv->getId());
     $action = new FeatureAv();
     $action->delete($event, null, $this->getMockEventDispatcher());
     $deletedFeatureAv = $event->getFeatureAv();
     $this->assertInstanceOf('Thelia\\Model\\FeatureAv', $deletedFeatureAv);
     $this->assertTrue($deletedFeatureAv->isDeleted());
 }
Exemplo n.º 2
0
 /**
  * Create a new feature entry
  *
  * @param FeatureAvCreateEvent $event
  * @param $eventName
  * @param EventDispatcherInterface $dispatcher
  */
 public function create(FeatureAvCreateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
 {
     $feature = new FeatureAvModel();
     $feature->setDispatcher($dispatcher)->setFeatureId($event->getFeatureId())->setLocale($event->getLocale())->setTitle($event->getTitle())->save();
     $event->setFeatureAv($feature);
 }
 /**
  * @param FeatureAv $object
  * @return int
  */
 protected function getObjectId($object)
 {
     return $object->getId();
 }
Exemplo n.º 4
0
 /**
  * Create a new feature entry
  *
  * @param FeatureAvCreateEvent $event
  */
 public function create(FeatureAvCreateEvent $event)
 {
     $feature = new FeatureAvModel();
     $feature->setDispatcher($event->getDispatcher())->setFeatureId($event->getFeatureId())->setLocale($event->getLocale())->setTitle($event->getTitle())->save();
     $event->setFeatureAv($feature);
 }
Exemplo n.º 5
0
 /**
  * Declares an association between this object and a ChildFeatureAv object.
  *
  * @param                  ChildFeatureAv $v
  * @return                 \Thelia\Model\FeatureAvI18n The current object (for fluent API support)
  * @throws PropelException
  */
 public function setFeatureAv(ChildFeatureAv $v = null)
 {
     if ($v === null) {
         $this->setId(NULL);
     } else {
         $this->setId($v->getId());
     }
     $this->aFeatureAv = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the ChildFeatureAv object, it will not be re-added.
     if ($v !== null) {
         $v->addFeatureAvI18n($this);
     }
     return $this;
 }
Exemplo n.º 6
0
 /**
  * Filter the query by a related \Thelia\Model\FeatureAv object
  *
  * @param \Thelia\Model\FeatureAv|ObjectCollection $featureAv The related object(s) to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildFeatureProductQuery The current query, for fluid interface
  */
 public function filterByFeatureAv($featureAv, $comparison = null)
 {
     if ($featureAv instanceof \Thelia\Model\FeatureAv) {
         return $this->addUsingAlias(FeatureProductTableMap::FEATURE_AV_ID, $featureAv->getId(), $comparison);
     } elseif ($featureAv instanceof ObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(FeatureProductTableMap::FEATURE_AV_ID, $featureAv->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByFeatureAv() only accepts arguments of type \\Thelia\\Model\\FeatureAv or Collection');
     }
 }
Exemplo n.º 7
0
 /**
  * Filter the query by a related \Thelia\Model\FeatureAv object
  *
  * @param \Thelia\Model\FeatureAv|ObjectCollection $featureAv  the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildFeatureQuery The current query, for fluid interface
  */
 public function filterByFeatureAv($featureAv, $comparison = null)
 {
     if ($featureAv instanceof \Thelia\Model\FeatureAv) {
         return $this->addUsingAlias(FeatureTableMap::ID, $featureAv->getFeatureId(), $comparison);
     } elseif ($featureAv instanceof ObjectCollection) {
         return $this->useFeatureAvQuery()->filterByPrimaryKeys($featureAv->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByFeatureAv() only accepts arguments of type \\Thelia\\Model\\FeatureAv or Collection');
     }
 }
Exemplo n.º 8
0
 /**
  * Exclude object from result
  *
  * @param   ChildFeatureAv $featureAv Object to remove from the list of results
  *
  * @return ChildFeatureAvQuery The current query, for fluid interface
  */
 public function prune($featureAv = null)
 {
     if ($featureAv) {
         $this->addUsingAlias(FeatureAvTableMap::ID, $featureAv->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }