/** * Filter the query by a related \App\Models\Subject object * * @param \App\Models\Subject|ObjectCollection $subject 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 filterBySubject($subject, $comparison = null) { if ($subject instanceof \App\Models\Subject) { return $this->addUsingAlias(EngagementTableMap::COL_SUBJECT_ID, $subject->getId(), $comparison); } elseif ($subject instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(EngagementTableMap::COL_SUBJECT_ID, $subject->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterBySubject() only accepts arguments of type \\App\\Models\\Subject or Collection'); } }