/**
  * Filter the query by a related Post object
  *
  * @param     Post $post  the related object to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return    CategoryQuery The current query, for fluid interface
  */
 public function filterByPost($post, $comparison = null)
 {
     if ($post instanceof Post) {
         return $this->addUsingAlias(CategoryPeer::ID, $post->getCategoryId(), $comparison);
     } elseif ($post instanceof PropelCollection) {
         return $this->usePostQuery()->filterByPrimaryKeys($post->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByPost() only accepts arguments of type Post or PropelCollection');
     }
 }