/** * Filter the query by a related \App\Models\SchoolYear object * * @param \App\Models\SchoolYear|ObjectCollection $schoolYear 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 ChildEngagementQuery The current query, for fluid interface */ public function filterBySchoolYear($schoolYear, $comparison = null) { if ($schoolYear instanceof \App\Models\SchoolYear) { return $this->addUsingAlias(EngagementTableMap::COL_SCHOOL_YEAR_ID, $schoolYear->getId(), $comparison); } elseif ($schoolYear instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(EngagementTableMap::COL_SCHOOL_YEAR_ID, $schoolYear->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterBySchoolYear() only accepts arguments of type \\App\\Models\\SchoolYear or Collection'); } }
/** * Declares an association between this object and a ChildSchoolYear object. * * @param ChildSchoolYear $v * @return $this|\App\Models\Application The current object (for fluent API support) * @throws PropelException */ public function setSchoolYear(ChildSchoolYear $v = null) { if ($v === null) { $this->setSchoolYearId(NULL); } else { $this->setSchoolYearId($v->getId()); } $this->aSchoolYear = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the ChildSchoolYear object, it will not be re-added. if ($v !== null) { $v->addApplication($this); } return $this; }
/** * Exclude object from result * * @param ChildSchoolYear $schoolYear Object to remove from the list of results * * @return $this|ChildSchoolYearQuery The current query, for fluid interface */ public function prune($schoolYear = null) { if ($schoolYear) { $this->addUsingAlias(SchoolYearTableMap::COL_ID, $schoolYear->getId(), Criteria::NOT_EQUAL); } return $this; }