/** * Filter the query by a related \Model\Truck object * * @param \Model\Truck|ObjectCollection $truck The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @throws \Propel\Runtime\Exception\PropelException * * @return ChildOrderQuery The current query, for fluid interface */ public function filterByTruck($truck, $comparison = null) { if ($truck instanceof \Model\Truck) { return $this->addUsingAlias(OrderTableMap::COL_TRUCK_ID, $truck->getId(), $comparison); } elseif ($truck instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(OrderTableMap::COL_TRUCK_ID, $truck->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByTruck() only accepts arguments of type \\Model\\Truck or Collection'); } }
/** * Exclude object from result * * @param ChildTruck $truck Object to remove from the list of results * * @return $this|ChildTruckQuery The current query, for fluid interface */ public function prune($truck = null) { if ($truck) { $this->addUsingAlias(TruckTableMap::COL_ID, $truck->getId(), Criteria::NOT_EQUAL); } return $this; }
/** * Declares an association between this object and a ChildTruck object. * * @param ChildTruck $v * @return $this|\Model\Order The current object (for fluent API support) * @throws PropelException */ public function setTruck(ChildTruck $v = null) { if ($v === null) { $this->setTruckId(NULL); } else { $this->setTruckId($v->getId()); } $this->aTruck = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the ChildTruck object, it will not be re-added. if ($v !== null) { $v->addOrder($this); } return $this; }