/** * Filter the query by a related \Thelia\Model\Hook object * * @param \Thelia\Model\Hook|ObjectCollection $hook The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildModuleHookQuery The current query, for fluid interface */ public function filterByHook($hook, $comparison = null) { if ($hook instanceof \Thelia\Model\Hook) { return $this->addUsingAlias(ModuleHookTableMap::HOOK_ID, $hook->getId(), $comparison); } elseif ($hook instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(ModuleHookTableMap::HOOK_ID, $hook->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByHook() only accepts arguments of type \\Thelia\\Model\\Hook or Collection'); } }