示例#1
0
 /**
  * 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->awork) {
         $this->awork->removeMilestone($this);
     }
     $this->id = null;
     $this->label = null;
     $this->work_id = null;
     $this->sortable_rank = null;
     $this->alreadyInSave = false;
     $this->clearAllReferences();
     $this->resetModified();
     $this->setNew(true);
     $this->setDeleted(false);
 }
示例#2
0
 /**
  * @param ChildWork $work The ChildWork object to add.
  */
 protected function doAddWork(ChildWork $work)
 {
     $this->collWorks[] = $work;
     $work->setcanon($this);
 }
示例#3
0
 /**
  * @param ChildWork $work The ChildWork object to add.
  */
 protected function doAddWork(ChildWork $work)
 {
     $this->collWorks[] = $work;
     $work->setprimaryArtist($this);
 }
示例#4
0
 /**
  * Filter the query by a related \SpoilerWiki\Work object
  *
  * @param \SpoilerWiki\Work|ObjectCollection $work the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildArtistQuery The current query, for fluid interface
  */
 public function filterByWork($work, $comparison = null)
 {
     if ($work instanceof \SpoilerWiki\Work) {
         return $this->addUsingAlias(ArtistTableMap::COL_ID, $work->getPrimaryArtistId(), $comparison);
     } elseif ($work instanceof ObjectCollection) {
         return $this->useWorkQuery()->filterByPrimaryKeys($work->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByWork() only accepts arguments of type \\SpoilerWiki\\Work or Collection');
     }
 }
示例#5
0
 /**
  * Exchange the rank of the object with the one passed as argument, and saves both objects
  *
  * @param     ChildWork $object
  * @param     ConnectionInterface $con optional connection
  *
  * @return    $this|ChildWork the current object
  *
  * @throws Exception if the database cannot execute the two updates
  */
 public function swapWith($object, ConnectionInterface $con = null)
 {
     if (null === $con) {
         $con = Propel::getServiceContainer()->getWriteConnection(WorkTableMap::DATABASE_NAME);
     }
     $con->transaction(function () use($con, $object) {
         $oldRank = $this->getSortableRank();
         $newRank = $object->getSortableRank();
         $this->setSortableRank($newRank);
         $object->setSortableRank($oldRank);
         $this->save($con);
         $object->save($con);
     });
     return $this;
 }
示例#6
0
 /**
  * Exclude object from result
  *
  * @param   ChildWork $work Object to remove from the list of results
  *
  * @return $this|ChildWorkQuery The current query, for fluid interface
  */
 public function prune($work = null)
 {
     if ($work) {
         $this->addUsingAlias(WorkTableMap::COL_ID, $work->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
 /**
  * Filter the query by a related \SpoilerWiki\Work object
  *
  * @param \SpoilerWiki\Work|ObjectCollection $work 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 ChildMilestoneQuery The current query, for fluid interface
  */
 public function filterBywork($work, $comparison = null)
 {
     if ($work instanceof \SpoilerWiki\Work) {
         return $this->addUsingAlias(MilestoneTableMap::COL_WORK_ID, $work->getId(), $comparison);
     } elseif ($work instanceof ObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(MilestoneTableMap::COL_WORK_ID, $work->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterBywork() only accepts arguments of type \\SpoilerWiki\\Work or Collection');
     }
 }