/** * @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()); }
/** * @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; }
/** * @param AttributeAv $object * @return int */ protected function getObjectId($object) { return $object->getId(); }
/** * 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; }