Example #1
0
 /**
  * Declares an association between this object and a ChildPublisher object.
  *
  * @param  ChildPublisher $v
  * @return $this|\testpropel\Book The current object (for fluent API support)
  * @throws PropelException
  */
 public function setPublisher(ChildPublisher $v = null)
 {
     if ($v === null) {
         $this->setPublisherId(NULL);
     } else {
         $this->setPublisherId($v->getId());
     }
     $this->aPublisher = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the ChildPublisher object, it will not be re-added.
     if ($v !== null) {
         $v->addBook($this);
     }
     return $this;
 }
Example #2
0
 /**
  * Filter the query by a related \testpropel\Publisher object
  *
  * @param \testpropel\Publisher|ObjectCollection $publisher 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 ChildBookQuery The current query, for fluid interface
  */
 public function filterByPublisher($publisher, $comparison = null)
 {
     if ($publisher instanceof \testpropel\Publisher) {
         return $this->addUsingAlias(BookTableMap::COL_PUBLISHER_ID, $publisher->getId(), $comparison);
     } elseif ($publisher instanceof ObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(BookTableMap::COL_PUBLISHER_ID, $publisher->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByPublisher() only accepts arguments of type \\testpropel\\Publisher or Collection');
     }
 }
 /**
  * Exclude object from result
  *
  * @param   ChildPublisher $publisher Object to remove from the list of results
  *
  * @return $this|ChildPublisherQuery The current query, for fluid interface
  */
 public function prune($publisher = null)
 {
     if ($publisher) {
         $this->addUsingAlias(PublisherTableMap::COL_ID, $publisher->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }