예제 #1
0
 /**
  * Filter the query by a related \gossi\trixionary\model\Reference object
  *
  * @param \gossi\trixionary\model\Reference|ObjectCollection $reference 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 ChildVideoQuery The current query, for fluid interface
  */
 public function filterByReference($reference, $comparison = null)
 {
     if ($reference instanceof \gossi\trixionary\model\Reference) {
         return $this->addUsingAlias(VideoTableMap::COL_REFERENCE_ID, $reference->getId(), $comparison);
     } elseif ($reference instanceof ObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(VideoTableMap::COL_REFERENCE_ID, $reference->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByReference() only accepts arguments of type \\gossi\\trixionary\\model\\Reference or Collection');
     }
 }