/** * Filter the query by a related \App\Propel\Unit object * * @param \App\Propel\Unit|ObjectCollection $unit 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 ChildUnitI18nQuery The current query, for fluid interface */ public function filterByUnit($unit, $comparison = null) { if ($unit instanceof \App\Propel\Unit) { return $this->addUsingAlias(UnitI18nTableMap::COL_UNIT_ID, $unit->getUnitId(), $comparison); } elseif ($unit instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(UnitI18nTableMap::COL_UNIT_ID, $unit->toKeyValue('PrimaryKey', 'UnitId'), $comparison); } else { throw new PropelException('filterByUnit() only accepts arguments of type \\App\\Propel\\Unit or Collection'); } }
/** * Exclude object from result * * @param ChildUnit $unit Object to remove from the list of results * * @return $this|ChildUnitQuery The current query, for fluid interface */ public function prune($unit = null) { if ($unit) { $this->addUsingAlias(UnitTableMap::COL_UNIT_ID, $unit->getUnitId(), Criteria::NOT_EQUAL); } return $this; }
/** * Declares an association between this object and a ChildUnit object. * * @param ChildUnit $v * @return $this|\App\Propel\UnitI18n The current object (for fluent API support) * @throws PropelException */ public function setUnit(ChildUnit $v = null) { if ($v === null) { $this->setUnitId(NULL); } else { $this->setUnitId($v->getUnitId()); } $this->aUnit = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the ChildUnit object, it will not be re-added. if ($v !== null) { $v->addUnitI18n($this); } return $this; }