コード例 #1
0
 /**
  * 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');
     }
 }
コード例 #2
0
 /**
  * Declares an association between this object and a ChildSubject object.
  *
  * @param  ChildSubject $v
  * @return $this|\App\Models\Application The current object (for fluent API support)
  * @throws PropelException
  */
 public function setSubject(ChildSubject $v = null)
 {
     if ($v === null) {
         $this->setSubjectId(NULL);
     } else {
         $this->setSubjectId($v->getId());
     }
     $this->aSubject = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the ChildSubject object, it will not be re-added.
     if ($v !== null) {
         $v->addApplication($this);
     }
     return $this;
 }
コード例 #3
0
 /**
  * Exclude object from result
  *
  * @param   ChildSubject $subject Object to remove from the list of results
  *
  * @return $this|ChildSubjectQuery The current query, for fluid interface
  */
 public function prune($subject = null)
 {
     if ($subject) {
         $this->addUsingAlias(SubjectTableMap::COL_ID, $subject->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }