コード例 #1
0
 /**
  * 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');
     }
 }