Author: sevein
Date: Thu Jun 21 17:11:53 2012
New Revision: 11792

Log:
Limit movements to siblings within the same level checkin parentId values (= 
sorting)

Modified:
   trunk/lib/model/om/BaseActor.php
   trunk/lib/model/om/BaseDigitalObject.php
   trunk/lib/model/om/BaseInformationObject.php
   trunk/lib/model/om/BaseMenu.php
   trunk/lib/model/om/BasePhysicalObject.php
   trunk/lib/model/om/BaseTaxonomy.php
   trunk/lib/model/om/BaseTerm.php
   trunk/lib/propel/builder/QubitObjectBuilder.php

Modified: trunk/lib/model/om/BaseActor.php
==============================================================================
--- trunk/lib/model/om/BaseActor.php    Thu Jun 21 16:49:27 2012        (r11791)
+++ trunk/lib/model/om/BaseActor.php    Thu Jun 21 17:11:53 2012        (r11792)
@@ -767,23 +767,11 @@
 
   public function moveToPrevSiblingOf($sibling, PropelPDO $con = null)
   {
-    /*
-    if (!$this->isInTree())
+    if ($this->parentId != $sibling->parentId)
     {
-      throw new PropelException('An object must be already in the tree to be 
moved. Use the insertAsPrevSiblingOf() instead.');
+      throw new PropelException('This functionality is limited to objects 
within the same level.');
     }
 
-    if ($sibling->isRoot())
-    {
-      throw new PropelException('Cannot move to previous sibling of a root 
node.');
-    }
-
-    if ($sibling->isDescendantOf($this))
-    {
-      throw new PropelException('Cannot move a node as sibling of one of its 
subtree nodes.');
-    }
-    */
-
     $this->moveSubtreeTo($sibling->lft, $con);
 
     return $this;
@@ -791,22 +779,10 @@
 
   public function moveToNextSiblingOf($sibling, PropelPDO $con = null)
   {
-    /*
-    if (!$this->isInTree())
-    {
-      throw new PropelException('An object must be already in the tree to be 
moved. Use the insertAsPrevSiblingOf() instead.');
-    }
-
-    if ($sibling->isRoot())
-    {
-      throw new PropelException('Cannot move to previous sibling of a root 
node.');
-    }
-
-    if ($sibling->isDescendantOf($this))
+    if ($this->parentId != $sibling->parentId)
     {
-      throw new PropelException('Cannot move a node as sibling of one of its 
subtree nodes.');
+      throw new PropelException('This functionality is limited to objects 
within the same level.');
     }
-    */
 
     $this->moveSubtreeTo($sibling->rgt + 1, $con);
 

Modified: trunk/lib/model/om/BaseDigitalObject.php
==============================================================================
--- trunk/lib/model/om/BaseDigitalObject.php    Thu Jun 21 16:49:27 2012        
(r11791)
+++ trunk/lib/model/om/BaseDigitalObject.php    Thu Jun 21 17:11:53 2012        
(r11792)
@@ -494,23 +494,11 @@
 
   public function moveToPrevSiblingOf($sibling, PropelPDO $con = null)
   {
-    /*
-    if (!$this->isInTree())
+    if ($this->parentId != $sibling->parentId)
     {
-      throw new PropelException('An object must be already in the tree to be 
moved. Use the insertAsPrevSiblingOf() instead.');
+      throw new PropelException('This functionality is limited to objects 
within the same level.');
     }
 
-    if ($sibling->isRoot())
-    {
-      throw new PropelException('Cannot move to previous sibling of a root 
node.');
-    }
-
-    if ($sibling->isDescendantOf($this))
-    {
-      throw new PropelException('Cannot move a node as sibling of one of its 
subtree nodes.');
-    }
-    */
-
     $this->moveSubtreeTo($sibling->lft, $con);
 
     return $this;
@@ -518,22 +506,10 @@
 
   public function moveToNextSiblingOf($sibling, PropelPDO $con = null)
   {
-    /*
-    if (!$this->isInTree())
-    {
-      throw new PropelException('An object must be already in the tree to be 
moved. Use the insertAsPrevSiblingOf() instead.');
-    }
-
-    if ($sibling->isRoot())
-    {
-      throw new PropelException('Cannot move to previous sibling of a root 
node.');
-    }
-
-    if ($sibling->isDescendantOf($this))
+    if ($this->parentId != $sibling->parentId)
     {
-      throw new PropelException('Cannot move a node as sibling of one of its 
subtree nodes.');
+      throw new PropelException('This functionality is limited to objects 
within the same level.');
     }
-    */
 
     $this->moveSubtreeTo($sibling->rgt + 1, $con);
 

Modified: trunk/lib/model/om/BaseInformationObject.php
==============================================================================
--- trunk/lib/model/om/BaseInformationObject.php        Thu Jun 21 16:49:27 
2012        (r11791)
+++ trunk/lib/model/om/BaseInformationObject.php        Thu Jun 21 17:11:53 
2012        (r11792)
@@ -745,23 +745,11 @@
 
   public function moveToPrevSiblingOf($sibling, PropelPDO $con = null)
   {
-    /*
-    if (!$this->isInTree())
+    if ($this->parentId != $sibling->parentId)
     {
-      throw new PropelException('An object must be already in the tree to be 
moved. Use the insertAsPrevSiblingOf() instead.');
+      throw new PropelException('This functionality is limited to objects 
within the same level.');
     }
 
-    if ($sibling->isRoot())
-    {
-      throw new PropelException('Cannot move to previous sibling of a root 
node.');
-    }
-
-    if ($sibling->isDescendantOf($this))
-    {
-      throw new PropelException('Cannot move a node as sibling of one of its 
subtree nodes.');
-    }
-    */
-
     $this->moveSubtreeTo($sibling->lft, $con);
 
     return $this;
@@ -769,22 +757,10 @@
 
   public function moveToNextSiblingOf($sibling, PropelPDO $con = null)
   {
-    /*
-    if (!$this->isInTree())
-    {
-      throw new PropelException('An object must be already in the tree to be 
moved. Use the insertAsPrevSiblingOf() instead.');
-    }
-
-    if ($sibling->isRoot())
-    {
-      throw new PropelException('Cannot move to previous sibling of a root 
node.');
-    }
-
-    if ($sibling->isDescendantOf($this))
+    if ($this->parentId != $sibling->parentId)
     {
-      throw new PropelException('Cannot move a node as sibling of one of its 
subtree nodes.');
+      throw new PropelException('This functionality is limited to objects 
within the same level.');
     }
-    */
 
     $this->moveSubtreeTo($sibling->rgt + 1, $con);
 

Modified: trunk/lib/model/om/BaseMenu.php
==============================================================================
--- trunk/lib/model/om/BaseMenu.php     Thu Jun 21 16:49:27 2012        (r11791)
+++ trunk/lib/model/om/BaseMenu.php     Thu Jun 21 17:11:53 2012        (r11792)
@@ -934,23 +934,11 @@
 
   public function moveToPrevSiblingOf($sibling, PropelPDO $con = null)
   {
-    /*
-    if (!$this->isInTree())
+    if ($this->parentId != $sibling->parentId)
     {
-      throw new PropelException('An object must be already in the tree to be 
moved. Use the insertAsPrevSiblingOf() instead.');
+      throw new PropelException('This functionality is limited to objects 
within the same level.');
     }
 
-    if ($sibling->isRoot())
-    {
-      throw new PropelException('Cannot move to previous sibling of a root 
node.');
-    }
-
-    if ($sibling->isDescendantOf($this))
-    {
-      throw new PropelException('Cannot move a node as sibling of one of its 
subtree nodes.');
-    }
-    */
-
     $this->moveSubtreeTo($sibling->lft, $con);
 
     return $this;
@@ -958,22 +946,10 @@
 
   public function moveToNextSiblingOf($sibling, PropelPDO $con = null)
   {
-    /*
-    if (!$this->isInTree())
-    {
-      throw new PropelException('An object must be already in the tree to be 
moved. Use the insertAsPrevSiblingOf() instead.');
-    }
-
-    if ($sibling->isRoot())
-    {
-      throw new PropelException('Cannot move to previous sibling of a root 
node.');
-    }
-
-    if ($sibling->isDescendantOf($this))
+    if ($this->parentId != $sibling->parentId)
     {
-      throw new PropelException('Cannot move a node as sibling of one of its 
subtree nodes.');
+      throw new PropelException('This functionality is limited to objects 
within the same level.');
     }
-    */
 
     $this->moveSubtreeTo($sibling->rgt + 1, $con);
 

Modified: trunk/lib/model/om/BasePhysicalObject.php
==============================================================================
--- trunk/lib/model/om/BasePhysicalObject.php   Thu Jun 21 16:49:27 2012        
(r11791)
+++ trunk/lib/model/om/BasePhysicalObject.php   Thu Jun 21 17:11:53 2012        
(r11792)
@@ -617,23 +617,11 @@
 
   public function moveToPrevSiblingOf($sibling, PropelPDO $con = null)
   {
-    /*
-    if (!$this->isInTree())
+    if ($this->parentId != $sibling->parentId)
     {
-      throw new PropelException('An object must be already in the tree to be 
moved. Use the insertAsPrevSiblingOf() instead.');
+      throw new PropelException('This functionality is limited to objects 
within the same level.');
     }
 
-    if ($sibling->isRoot())
-    {
-      throw new PropelException('Cannot move to previous sibling of a root 
node.');
-    }
-
-    if ($sibling->isDescendantOf($this))
-    {
-      throw new PropelException('Cannot move a node as sibling of one of its 
subtree nodes.');
-    }
-    */
-
     $this->moveSubtreeTo($sibling->lft, $con);
 
     return $this;
@@ -641,22 +629,10 @@
 
   public function moveToNextSiblingOf($sibling, PropelPDO $con = null)
   {
-    /*
-    if (!$this->isInTree())
-    {
-      throw new PropelException('An object must be already in the tree to be 
moved. Use the insertAsPrevSiblingOf() instead.');
-    }
-
-    if ($sibling->isRoot())
-    {
-      throw new PropelException('Cannot move to previous sibling of a root 
node.');
-    }
-
-    if ($sibling->isDescendantOf($this))
+    if ($this->parentId != $sibling->parentId)
     {
-      throw new PropelException('Cannot move a node as sibling of one of its 
subtree nodes.');
+      throw new PropelException('This functionality is limited to objects 
within the same level.');
     }
-    */
 
     $this->moveSubtreeTo($sibling->rgt + 1, $con);
 

Modified: trunk/lib/model/om/BaseTaxonomy.php
==============================================================================
--- trunk/lib/model/om/BaseTaxonomy.php Thu Jun 21 16:49:27 2012        (r11791)
+++ trunk/lib/model/om/BaseTaxonomy.php Thu Jun 21 17:11:53 2012        (r11792)
@@ -652,23 +652,11 @@
 
   public function moveToPrevSiblingOf($sibling, PropelPDO $con = null)
   {
-    /*
-    if (!$this->isInTree())
+    if ($this->parentId != $sibling->parentId)
     {
-      throw new PropelException('An object must be already in the tree to be 
moved. Use the insertAsPrevSiblingOf() instead.');
+      throw new PropelException('This functionality is limited to objects 
within the same level.');
     }
 
-    if ($sibling->isRoot())
-    {
-      throw new PropelException('Cannot move to previous sibling of a root 
node.');
-    }
-
-    if ($sibling->isDescendantOf($this))
-    {
-      throw new PropelException('Cannot move a node as sibling of one of its 
subtree nodes.');
-    }
-    */
-
     $this->moveSubtreeTo($sibling->lft, $con);
 
     return $this;
@@ -676,22 +664,10 @@
 
   public function moveToNextSiblingOf($sibling, PropelPDO $con = null)
   {
-    /*
-    if (!$this->isInTree())
-    {
-      throw new PropelException('An object must be already in the tree to be 
moved. Use the insertAsPrevSiblingOf() instead.');
-    }
-
-    if ($sibling->isRoot())
-    {
-      throw new PropelException('Cannot move to previous sibling of a root 
node.');
-    }
-
-    if ($sibling->isDescendantOf($this))
+    if ($this->parentId != $sibling->parentId)
     {
-      throw new PropelException('Cannot move a node as sibling of one of its 
subtree nodes.');
+      throw new PropelException('This functionality is limited to objects 
within the same level.');
     }
-    */
 
     $this->moveSubtreeTo($sibling->rgt + 1, $con);
 

Modified: trunk/lib/model/om/BaseTerm.php
==============================================================================
--- trunk/lib/model/om/BaseTerm.php     Thu Jun 21 16:49:27 2012        (r11791)
+++ trunk/lib/model/om/BaseTerm.php     Thu Jun 21 17:11:53 2012        (r11792)
@@ -1879,23 +1879,11 @@
 
   public function moveToPrevSiblingOf($sibling, PropelPDO $con = null)
   {
-    /*
-    if (!$this->isInTree())
+    if ($this->parentId != $sibling->parentId)
     {
-      throw new PropelException('An object must be already in the tree to be 
moved. Use the insertAsPrevSiblingOf() instead.');
+      throw new PropelException('This functionality is limited to objects 
within the same level.');
     }
 
-    if ($sibling->isRoot())
-    {
-      throw new PropelException('Cannot move to previous sibling of a root 
node.');
-    }
-
-    if ($sibling->isDescendantOf($this))
-    {
-      throw new PropelException('Cannot move a node as sibling of one of its 
subtree nodes.');
-    }
-    */
-
     $this->moveSubtreeTo($sibling->lft, $con);
 
     return $this;
@@ -1903,22 +1891,10 @@
 
   public function moveToNextSiblingOf($sibling, PropelPDO $con = null)
   {
-    /*
-    if (!$this->isInTree())
-    {
-      throw new PropelException('An object must be already in the tree to be 
moved. Use the insertAsPrevSiblingOf() instead.');
-    }
-
-    if ($sibling->isRoot())
-    {
-      throw new PropelException('Cannot move to previous sibling of a root 
node.');
-    }
-
-    if ($sibling->isDescendantOf($this))
+    if ($this->parentId != $sibling->parentId)
     {
-      throw new PropelException('Cannot move a node as sibling of one of its 
subtree nodes.');
+      throw new PropelException('This functionality is limited to objects 
within the same level.');
     }
-    */
 
     $this->moveSubtreeTo($sibling->rgt + 1, $con);
 

Modified: trunk/lib/propel/builder/QubitObjectBuilder.php
==============================================================================
--- trunk/lib/propel/builder/QubitObjectBuilder.php     Thu Jun 21 16:49:27 
2012        (r11791)
+++ trunk/lib/propel/builder/QubitObjectBuilder.php     Thu Jun 21 17:11:53 
2012        (r11792)
@@ -2037,23 +2037,11 @@
 
   public function moveToPrevSiblingOf(\$sibling, PropelPDO \$con = null)
   {
-    /*
-    if (!\$this->isInTree())
+    if (\$this->parentId != \$sibling->parentId)
     {
-      throw new PropelException('An object must be already in the tree to be 
moved. Use the insertAsPrevSiblingOf() instead.');
+      throw new PropelException('This functionality is limited to objects 
within the same level.');
     }
 
-    if (\$sibling->isRoot())
-    {
-      throw new PropelException('Cannot move to previous sibling of a root 
node.');
-    }
-
-    if (\$sibling->isDescendantOf(\$this))
-    {
-      throw new PropelException('Cannot move a node as sibling of one of its 
subtree nodes.');
-    }
-    */
-
     \$this->moveSubtreeTo(\$sibling->lft, \$con);
 
     return \$this;
@@ -2068,22 +2056,10 @@
 
   public function moveToNextSiblingOf(\$sibling, PropelPDO \$con = null)
   {
-    /*
-    if (!\$this->isInTree())
-    {
-      throw new PropelException('An object must be already in the tree to be 
moved. Use the insertAsPrevSiblingOf() instead.');
-    }
-
-    if (\$sibling->isRoot())
-    {
-      throw new PropelException('Cannot move to previous sibling of a root 
node.');
-    }
-
-    if (\$sibling->isDescendantOf(\$this))
+    if (\$this->parentId != \$sibling->parentId)
     {
-      throw new PropelException('Cannot move a node as sibling of one of its 
subtree nodes.');
+      throw new PropelException('This functionality is limited to objects 
within the same level.');
     }
-    */
 
     \$this->moveSubtreeTo(\$sibling->rgt + 1, \$con);
 

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-commits?hl=en.

Reply via email to