/** * Adds an object to the instance pool. * * Propel keeps cached copies of objects in an instance pool when they are retrieved * from the database. In some cases you may need to explicitly add objects * to the cache in order to ensure that the same objects are always returned by find*() * and findPk*() calls. * * @param \gossi\trixionary\model\StructureNodeParent $obj A \gossi\trixionary\model\StructureNodeParent object. * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). */ public static function addInstanceToPool($obj, $key = null) { if (Propel::isInstancePoolingEnabled()) { if (null === $key) { $key = serialize(array((string) $obj->getStructureNodeId(), (string) $obj->getParentId())); } // if key === null self::$instances[$key] = $obj; } }
/** * Remove structureNodeRelatedByStructureNodeId of this object * through the kk_trixionary_structure_node_parent cross reference table. * * @param ChildStructureNode $structureNodeRelatedByStructureNodeId * @return ChildStructureNode The current object (for fluent API support) */ public function removeStructureNodeRelatedByStructureNodeId(ChildStructureNode $structureNodeRelatedByStructureNodeId) { if ($this->getStructureNodesRelatedByStructureNodeId()->contains($structureNodeRelatedByStructureNodeId)) { $structureNodeParent = new ChildStructureNodeParent(); $structureNodeParent->setStructureNodeRelatedByStructureNodeId($structureNodeRelatedByStructureNodeId); if ($structureNodeRelatedByStructureNodeId->isStructureNodeRelatedByParentIdsLoaded()) { //remove the back reference if available $structureNodeRelatedByStructureNodeId->getStructureNodeRelatedByParentIds()->removeObject($this); } $structureNodeParent->setStructureNodeRelatedByParentId($this); $this->removeStructureNodeParentRelatedByParentId(clone $structureNodeParent); $structureNodeParent->clear(); $this->collStructureNodesRelatedByStructureNodeId->remove($this->collStructureNodesRelatedByStructureNodeId->search($structureNodeRelatedByStructureNodeId)); if (null === $this->structureNodesRelatedByStructureNodeIdScheduledForDeletion) { $this->structureNodesRelatedByStructureNodeIdScheduledForDeletion = clone $this->collStructureNodesRelatedByStructureNodeId; $this->structureNodesRelatedByStructureNodeIdScheduledForDeletion->clear(); } $this->structureNodesRelatedByStructureNodeIdScheduledForDeletion->push($structureNodeRelatedByStructureNodeId); } return $this; }
/** * Filter the query by a related \gossi\trixionary\model\StructureNodeParent object * * @param \gossi\trixionary\model\StructureNodeParent|ObjectCollection $structureNodeParent the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildStructureNodeQuery The current query, for fluid interface */ public function filterByStructureNodeParentRelatedByParentId($structureNodeParent, $comparison = null) { if ($structureNodeParent instanceof \gossi\trixionary\model\StructureNodeParent) { return $this->addUsingAlias(StructureNodeTableMap::COL_ID, $structureNodeParent->getParentId(), $comparison); } elseif ($structureNodeParent instanceof ObjectCollection) { return $this->useStructureNodeParentRelatedByParentIdQuery()->filterByPrimaryKeys($structureNodeParent->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByStructureNodeParentRelatedByParentId() only accepts arguments of type \\gossi\\trixionary\\model\\StructureNodeParent or Collection'); } }
/** * Exclude object from result * * @param ChildStructureNodeParent $structureNodeParent Object to remove from the list of results * * @return $this|ChildStructureNodeParentQuery The current query, for fluid interface */ public function prune($structureNodeParent = null) { if ($structureNodeParent) { $this->addCond('pruneCond0', $this->getAliasedColName(StructureNodeParentTableMap::COL_STRUCTURE_NODE_ID), $structureNodeParent->getStructureNodeId(), Criteria::NOT_EQUAL); $this->addCond('pruneCond1', $this->getAliasedColName(StructureNodeParentTableMap::COL_PARENT_ID), $structureNodeParent->getParentId(), Criteria::NOT_EQUAL); $this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR); } return $this; }