/** * Filter the query by a related \Data object * * @param \Data|ObjectCollection $data the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildTemplatesQuery The current query, for fluid interface */ public function filterByData($data, $comparison = null) { if ($data instanceof \Data) { return $this->addUsingAlias(TemplatesTableMap::COL_ID, $data->getFortemplatefield(), $comparison); } elseif ($data instanceof ObjectCollection) { return $this->useDataQuery()->filterByPrimaryKeys($data->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByData() only accepts arguments of type \\Data or Collection'); } }