/**
  * Filter the query by a related \Books object
  *
  * @param \Books|ObjectCollection $books 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 ChildRBatchForbookQuery The current query, for fluid interface
  */
 public function filterByBooks($books, $comparison = null)
 {
     if ($books instanceof \Books) {
         return $this->addUsingAlias(RBatchForbookTableMap::COL__BOOKID, $books->getId(), $comparison);
     } elseif ($books instanceof ObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(RBatchForbookTableMap::COL__BOOKID, $books->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByBooks() only accepts arguments of type \\Books or Collection');
     }
 }
Example #2
0
 /**
  * Exclude object from result
  *
  * @param   ChildBooks $books Object to remove from the list of results
  *
  * @return $this|ChildBooksQuery The current query, for fluid interface
  */
 public function prune($books = null)
 {
     if ($books) {
         $this->addUsingAlias(BooksTableMap::COL_ID, $books->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
Example #3
0
 /**
  * Declares an association between this object and a ChildBooks object.
  *
  * @param  ChildBooks $v
  * @return $this|\RRightsForbook The current object (for fluent API support)
  * @throws PropelException
  */
 public function setBooks(ChildBooks $v = null)
 {
     if ($v === null) {
         $this->setBookid(NULL);
     } else {
         $this->setBookid($v->getId());
     }
     $this->aBooks = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the ChildBooks object, it will not be re-added.
     if ($v !== null) {
         $v->addRRightsForbook($this);
     }
     return $this;
 }