/** * Filter the query by a related \App\Propel\Category object * * @param \App\Propel\Category|ObjectCollection $category the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildFileQuery The current query, for fluid interface */ public function filterByCategory($category, $comparison = null) { if ($category instanceof \App\Propel\Category) { return $this->addUsingAlias(FileTableMap::COL_FILE_ID, $category->getCategoryPic(), $comparison); } elseif ($category instanceof ObjectCollection) { return $this->useCategoryQuery()->filterByPrimaryKeys($category->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByCategory() only accepts arguments of type \\App\\Propel\\Category or Collection'); } }