/** * Filter the query by a related \App\Models\Engagement object * * @param \App\Models\Engagement|ObjectCollection $engagement the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildSubjectQuery The current query, for fluid interface */ public function filterByEngagement($engagement, $comparison = null) { if ($engagement instanceof \App\Models\Engagement) { return $this->addUsingAlias(SubjectTableMap::COL_ID, $engagement->getSubjectId(), $comparison); } elseif ($engagement instanceof ObjectCollection) { return $this->useEngagementQuery()->filterByPrimaryKeys($engagement->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByEngagement() only accepts arguments of type \\App\\Models\\Engagement or Collection'); } }