示例#1
0
 /**
  * Filter the query by a related \SpoilerWiki\Topic object
  *
  * @param \SpoilerWiki\Topic|ObjectCollection $topic 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 ChildSummaryQuery The current query, for fluid interface
  */
 public function filterBytopic($topic, $comparison = null)
 {
     if ($topic instanceof \SpoilerWiki\Topic) {
         return $this->addUsingAlias(SummaryTableMap::COL_TOPIC_ID, $topic->getId(), $comparison);
     } elseif ($topic instanceof ObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(SummaryTableMap::COL_TOPIC_ID, $topic->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterBytopic() only accepts arguments of type \\SpoilerWiki\\Topic or Collection');
     }
 }
示例#2
0
 /**
  * Declares an association between this object and a ChildTopic object.
  *
  * @param  ChildTopic $v
  * @return $this|\SpoilerWiki\Snippet The current object (for fluent API support)
  * @throws PropelException
  */
 public function settopic(ChildTopic $v = null)
 {
     if ($v === null) {
         $this->setTopicId(NULL);
     } else {
         $this->setTopicId($v->getId());
     }
     $this->atopic = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the ChildTopic object, it will not be re-added.
     if ($v !== null) {
         $v->addSnippet($this);
     }
     return $this;
 }
示例#3
0
 /**
  * Exclude object from result
  *
  * @param   ChildTopic $topic Object to remove from the list of results
  *
  * @return $this|ChildTopicQuery The current query, for fluid interface
  */
 public function prune($topic = null)
 {
     if ($topic) {
         $this->addUsingAlias(TopicTableMap::COL_ID, $topic->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }