/** * Filter the query by a related \Anand\Make object * * @param \Anand\Make|ObjectCollection $make 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 ChildVehicleQuery The current query, for fluid interface */ public function filterByMake($make, $comparison = null) { if ($make instanceof \Anand\Make) { return $this->addUsingAlias(VehicleTableMap::COL_MAKE_ID, $make->getId(), $comparison); } elseif ($make instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(VehicleTableMap::COL_MAKE_ID, $make->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByMake() only accepts arguments of type \\Anand\\Make or Collection'); } }
/** * Declares an association between this object and a ChildMake object. * * @param ChildMake $v * @return $this|\Anand\Vehicle The current object (for fluent API support) * @throws PropelException */ public function setMake(ChildMake $v = null) { if ($v === null) { $this->setMakeId(NULL); } else { $this->setMakeId($v->getId()); } $this->aMake = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the ChildMake object, it will not be re-added. if ($v !== null) { $v->addVehicle($this); } return $this; }
/** * Exclude object from result * * @param ChildMake $make Object to remove from the list of results * * @return $this|ChildMakeQuery The current query, for fluid interface */ public function prune($make = null) { if ($make) { $this->addUsingAlias(MakeTableMap::COL_ID, $make->getId(), Criteria::NOT_EQUAL); } return $this; }