/** * Declares an association between this object and a ChildSnippet object. * * @param ChildSnippet $v * @return $this|\SpoilerWiki\ContentArea The current object (for fluent API support) * @throws PropelException */ public function setSnippet(ChildSnippet $v = null) { if ($v === null) { $this->setId(NULL); } else { $this->setId($v->getId()); } $this->aSnippet = $v; // Add binding for other direction of this 1:1 relationship. if ($v !== null) { $v->setContentArea($this); } return $this; }
/** * Filter the query by a related \SpoilerWiki\Snippet object * * @param \SpoilerWiki\Snippet|ObjectCollection $snippet 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 ChildContentAreaQuery The current query, for fluid interface */ public function filterBySnippet($snippet, $comparison = null) { if ($snippet instanceof \SpoilerWiki\Snippet) { return $this->addUsingAlias(ContentAreaTableMap::COL_ID, $snippet->getId(), $comparison); } elseif ($snippet instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(ContentAreaTableMap::COL_ID, $snippet->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterBySnippet() only accepts arguments of type \\SpoilerWiki\\Snippet or Collection'); } }
/** * Exclude object from result * * @param ChildSnippet $snippet Object to remove from the list of results * * @return $this|ChildSnippetQuery The current query, for fluid interface */ public function prune($snippet = null) { if ($snippet) { $this->addUsingAlias(SnippetTableMap::COL_ID, $snippet->getId(), Criteria::NOT_EQUAL); } return $this; }