/** * Declares an association between this object and a ChildPost object. * * @param ChildPost $v * @return $this|\propel2\Comment The current object (for fluent API support) * @throws PropelException */ public function setPost(ChildPost $v = null) { if ($v === null) { $this->setPostId(NULL); } else { $this->setPostId($v->getId()); } $this->aPost = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the ChildPost object, it will not be re-added. if ($v !== null) { $v->addComment($this); } return $this; }
/** * Exclude object from result * * @param ChildPost $post Object to remove from the list of results * * @return $this|ChildPostQuery The current query, for fluid interface */ public function prune($post = null) { if ($post) { $this->addUsingAlias(PostTableMap::COL_ID, $post->getId(), Criteria::NOT_EQUAL); } return $this; }
/** * Filter the query by a related \propel2\Post object * * @param \propel2\Post|ObjectCollection $post 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 ChildCommentQuery The current query, for fluid interface */ public function filterByPost($post, $comparison = null) { if ($post instanceof \propel2\Post) { return $this->addUsingAlias(CommentTableMap::COL_POST_ID, $post->getId(), $comparison); } elseif ($post instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(CommentTableMap::COL_POST_ID, $post->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByPost() only accepts arguments of type \\propel2\\Post or Collection'); } }