/** * Clears the current object, sets all attributes to their default values and removes * outgoing references as well as back-references (from other objects to this one. Results probably in a database * change of those foreign objects when you call `save` there). */ public function clear() { if (null !== $this->aPost) { $this->aPost->removeComment($this); } $this->id = null; $this->post_id = null; $this->body = null; $this->created_at = null; $this->updated_at = null; $this->alreadyInSave = false; $this->clearAllReferences(); $this->resetModified(); $this->setNew(true); $this->setDeleted(false); }
/** * 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'); } }