/** * @param MessageModel $message * @depends testModify */ public function testDelete(MessageModel $message) { $event = new MessageDeleteEvent($message->getId()); $action = new Message(); $action->delete($event, null, $this->getMockEventDispatcher()); $deletedMessage = $event->getMessage(); $this->assertInstanceOf('Thelia\\Model\\Message', $deletedMessage); $this->assertTrue($deletedMessage->isDeleted()); }
/** * @param Message $object * @return int */ protected function getObjectId($object) { return $object->getId(); }
/** * Exclude object from result * * @param ChildMessage $message Object to remove from the list of results * * @return ChildMessageQuery The current query, for fluid interface */ public function prune($message = null) { if ($message) { $this->addUsingAlias(MessageTableMap::ID, $message->getId(), Criteria::NOT_EQUAL); } return $this; }
/** * Declares an association between this object and a ChildMessage object. * * @param ChildMessage $v * @return \Thelia\Model\MessageVersion The current object (for fluent API support) * @throws PropelException */ public function setMessage(ChildMessage $v = null) { if ($v === null) { $this->setId(NULL); } else { $this->setId($v->getId()); } $this->aMessage = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the ChildMessage object, it will not be re-added. if ($v !== null) { $v->addMessageVersion($this); } return $this; }
/** * Filter the query by a related \Thelia\Model\Message object * * @param \Thelia\Model\Message|ObjectCollection $message The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildMessageVersionQuery The current query, for fluid interface */ public function filterByMessage($message, $comparison = null) { if ($message instanceof \Thelia\Model\Message) { return $this->addUsingAlias(MessageVersionTableMap::ID, $message->getId(), $comparison); } elseif ($message instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(MessageVersionTableMap::ID, $message->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByMessage() only accepts arguments of type \\Thelia\\Model\\Message or Collection'); } }