Esempio n. 1
0
 /**
  * Filter the query by a related \SpoilerWiki\Canon object
  *
  * @param \SpoilerWiki\Canon|ObjectCollection $canon The related object(s) to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @throws \Propel\Runtime\Exception\PropelException
  *
  * @return ChildTopicQuery The current query, for fluid interface
  */
 public function filterBycanon($canon, $comparison = null)
 {
     if ($canon instanceof \SpoilerWiki\Canon) {
         return $this->addUsingAlias(TopicTableMap::COL_CANON_ID, $canon->getId(), $comparison);
     } elseif ($canon instanceof ObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(TopicTableMap::COL_CANON_ID, $canon->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterBycanon() only accepts arguments of type \\SpoilerWiki\\Canon or Collection');
     }
 }