/** * 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->atopic) { $this->atopic->removeSnippet($this); } if (null !== $this->aintroducedAt) { $this->aintroducedAt->removeSnippet($this); } $this->id = null; $this->topic_id = null; $this->introduced_at = null; $this->alreadyInSave = false; $this->clearAllReferences(); $this->resetModified(); $this->setNew(true); $this->setDeleted(false); }
/** * Exchange the rank of the object with the one passed as argument, and saves both objects * * @param ChildMilestone $object * @param ConnectionInterface $con optional connection * * @return $this|ChildMilestone 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(MilestoneTableMap::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; }
/** * Filter the query by a related \SpoilerWiki\Milestone object * * @param \SpoilerWiki\Milestone|ObjectCollection $milestone 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 ChildSummaryQuery The current query, for fluid interface */ public function filterByupdatedAt($milestone, $comparison = null) { if ($milestone instanceof \SpoilerWiki\Milestone) { return $this->addUsingAlias(SummaryTableMap::COL_INTRODUCED_AT, $milestone->getId(), $comparison); } elseif ($milestone instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(SummaryTableMap::COL_INTRODUCED_AT, $milestone->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByupdatedAt() only accepts arguments of type \\SpoilerWiki\\Milestone or Collection'); } }
/** * @param ChildMilestone $milestone The ChildMilestone object to add. */ protected function doAddMilestone(ChildMilestone $milestone) { $this->collMilestones[] = $milestone; $milestone->setwork($this); }
/** * Filter the query by a related \SpoilerWiki\Milestone object * * @param \SpoilerWiki\Milestone|ObjectCollection $milestone the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildWorkQuery The current query, for fluid interface */ public function filterByMilestone($milestone, $comparison = null) { if ($milestone instanceof \SpoilerWiki\Milestone) { return $this->addUsingAlias(WorkTableMap::COL_ID, $milestone->getWorkId(), $comparison); } elseif ($milestone instanceof ObjectCollection) { return $this->useMilestoneQuery()->filterByPrimaryKeys($milestone->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByMilestone() only accepts arguments of type \\SpoilerWiki\\Milestone or Collection'); } }
/** * Exclude object from result * * @param ChildMilestone $milestone Object to remove from the list of results * * @return $this|ChildMilestoneQuery The current query, for fluid interface */ public function prune($milestone = null) { if ($milestone) { $this->addUsingAlias(MilestoneTableMap::COL_ID, $milestone->getId(), Criteria::NOT_EQUAL); } return $this; }
/** * 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->acanon) { $this->acanon->removeTopic($this); } if (null !== $this->aintroducedAt) { $this->aintroducedAt->removeTopic($this); } $this->id = null; $this->name = null; $this->canon_id = null; $this->introduced_at = null; $this->alreadyInSave = false; $this->clearAllReferences(); $this->resetModified(); $this->setNew(true); $this->setDeleted(false); }