コード例 #1
0
 /**
  * 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;
 }
コード例 #2
0
ファイル: BookQuery.php プロジェクト: sam-higton/PropelToSlim
 /**
  * Filter the query by a related \Publisher object
  *
  * @param \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 \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 \\Publisher or Collection');
     }
 }
コード例 #3
0
ファイル: Book.php プロジェクト: sam-higton/PropelToSlim
 /**
  * Clears the current object, sets all attributes to their default values and removes
  * outgoing references as well as back-references (from other objects to this one. Results probably in a database
  * change of those foreign objects when you call `save` there).
  */
 public function clear()
 {
     if (null !== $this->aPublisher) {
         $this->aPublisher->removeBook($this);
     }
     if (null !== $this->aAuthor) {
         $this->aAuthor->removeBook($this);
     }
     $this->id = null;
     $this->title = null;
     $this->isbn = null;
     $this->publisher_id = null;
     $this->author_id = null;
     $this->alreadyInSave = false;
     $this->clearAllReferences();
     $this->resetModified();
     $this->setNew(true);
     $this->setDeleted(false);
 }