Bläddra i källkod

[docs] update tree specific changes

Gediminas Morkevicius 14 år sedan
förälder
incheckning
aee5b41042
2 ändrade filer med 11 tillägg och 13 borttagningar
  1. 2 3
      README.markdown
  2. 9 10
      doc/tree.md

+ 2 - 3
README.markdown

@@ -55,12 +55,11 @@ PHPUnit 3.4 or newer is required.
 To setup and run tests follow these steps:
 To setup and run tests follow these steps:
 
 
 - go to the root directory of extensions
 - go to the root directory of extensions
-- run: **git submodule init**
-- run: **git submodule update**
+- run: **git submodule update --init**
 - go to tests directory: **cd tests**
 - go to tests directory: **cd tests**
 - run **cp phpunit.dist.xml phpunit.xml**
 - run **cp phpunit.dist.xml phpunit.xml**
 - run: **phpunit**
 - run: **phpunit**
-- optional - run mongodb in background to complete all tests 
+- optional - run mongodb in background to complete all tests
 
 
 ### Contributors:
 ### Contributors:
 
 

+ 9 - 10
doc/tree.md

@@ -21,6 +21,10 @@ Thanks for contributions to:
 - **[everzet](http://github.com/everzet) Kudryashov Konstantin** for TreeLevel implementation
 - **[everzet](http://github.com/everzet) Kudryashov Konstantin** for TreeLevel implementation
 - **[stof](http://github.com/stof) Christophe Coevoet** for getTreeLeafs function
 - **[stof](http://github.com/stof) Christophe Coevoet** for getTreeLeafs function
 
 
+Update **2011-04-11**
+
+- Made in memory node synchronization, this change does not require clearing the cached nodes after any updates
+to nodes, except **recover, verify and removeFromTree** operations.
 
 
 Update **2011-02-08**
 Update **2011-02-08**
 
 
@@ -34,11 +38,6 @@ Update **2011-02-02**
 - Refactored the Tree to the ability on supporting diferent tree models
 - Refactored the Tree to the ability on supporting diferent tree models
 - Changed the repository location in order to support future updates
 - Changed the repository location in order to support future updates
 
 
-Update **2010-12-23**
-
-- Optimized for concurrent updates, changed some yaml mapping definitions
-- Table inheritance mapping now is fully supported by tree repository functions
-
 **Notice:**
 **Notice:**
 
 
 - You can [test live][blog_test] on this blog
 - You can [test live][blog_test] on this blog
@@ -147,7 +146,7 @@ cache is activated
         
         
         /**
         /**
          * @gedmo:TreeRoot
          * @gedmo:TreeRoot
-         * @Column(name="root", type="integer")
+         * @Column(name="root", type="integer", nullable=true)
          */
          */
         private $root;
         private $root;
         
         
@@ -229,6 +228,7 @@ Yaml mapped Category: **/mapping/yaml/Entity.Category.dcm.yml**
             - treeRight
             - treeRight
         root:
         root:
           type: integer
           type: integer
+          nullable: true
           gedmo:
           gedmo:
             - treeRoot
             - treeRoot
         lvl:
         lvl:
@@ -310,6 +310,7 @@ The result after flush will generate the food tree:
     // single node removal
     // single node removal
     $vegies = $repo->findOneByTitle('Vegitables');
     $vegies = $repo->findOneByTitle('Vegitables');
     $repo->removeFromTree($vegies);
     $repo->removeFromTree($vegies);
+    $em->clear(); // clear cached nodes
     // it will remove this node from tree and reparent all children
     // it will remove this node from tree and reparent all children
     
     
     // reordering the tree
     // reordering the tree
@@ -359,11 +360,9 @@ Tree after moving the Carrots down:
             /Carrots <- moved down to the end
             /Carrots <- moved down to the end
         /Fruits
         /Fruits
 
 
-**Notice:** tree repository functions like: **reorder, verify**. 
+**Notice:** tree repository functions: **verify, recover, removeFromTree**. 
 Will require to clear the cache of Entity Manager because left-right values will differ.
 Will require to clear the cache of Entity Manager because left-right values will differ.
-So after that use $em->clear(); if you will continue using the nodes after these operations.
-After using **moveUp, moveDown** it is also recommended to refresh the node
-using $em->refresh($node);
+So after that use `$em->clear();` if you will continue using the nodes after these operations.
 
 
 ### If you need a repository for your TreeNode Entity simply extend it
 ### If you need a repository for your TreeNode Entity simply extend it