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