Recommend this page to a friend! |
Download .zip |
Info | View files (4) | Download .zip | Reputation | Support forum (5) | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2012-08-17 (4 years ago) | Not enough user ratings | Total: 881 | All time: 3,828 This week: 1,042 |
Version | License | PHP version | Categories | |||
nested-set-db-table 2.0 | GNU General Publi... | 5.0 | PHP 5, Databases, Data types |
Description | Author | |||||||||||||
This package can be used to manage nested sets of data stored in a database. |
|
NestedSetDbTable is a abstract class that provides API for managing some table which has data that is organized in "Nested set model" manner. Developers should extend this class in order to use its functionality. Properties $_name (name of the table), $_primary (name of the primary key), $_left (left column name in nested table) and $_right (right column name in nested table) must be overrriden in the extending class and filled with appropriate values. PDO instance must be supplied to the object of this class in order to use it. AUTHOR ------ Nikola Posa <posa.nikola@gmail.com> INSTALLATION ------------ 1. You should put folder, in which you've stored NestedSetDbTable dir, in the include path. Here's an example of how to do that: set_include_path('.' . PATH_SEPARATOR . 'path/to/libs' . PATH_SEPARATOR . get_include_path()); ... where "libs" is name of the folder where you've stored NestedSetDbTable dir. FEATURES -------- * API for managing database table, which has data that is organized in "Nested set model" manner, * Methods for implementing Nested set model, * getTree() method gets whole tree, including depth information, * insert() method enables adding new node at desired position in tree hierarchy, * updateNode() method enables updating data of some node, including its position in tree hierarchy, * deleteNode() method is used for deleting nodes, and it has option for deleting only desired node (without its child nodes), or deleting its child nodes as well USAGE ----- class Categories extends NestedSetDbTable_Abstract { protected $_name = 'categories'; protected $_primary = 'id'; protected $_left = 'left'; protected $_right = 'right'; } $pdo = new PDO('mysql:dbname=test;host=127.0.0.1', 'root', ''); //Setting db adapter for all instances of NestedSetDbTable_Abstract class: NestedSetDbTable_Abstract::setDefaultAdapter($pdo); $categories = new Categories(); print_r($categories->getTree()); SYSTEM REQUIREMENTS ------------------- NestedSetDbTable package requires PHP 5 or later, with enabled PDO extension. LICENSE ------- The files in this archive are released under the GNU General Public License. You can find a copy of this license in LICENSE.txt. |
Files |
File | Role | Description | ||
---|---|---|---|---|
libs (1 directory) | ||||
LICENSE.txt | Lic. | License file. | ||
README.txt | Doc. | Readme file. |
Files | / | libs | / | NestedSetDbTable |
File | Role | Description |
---|---|---|
Abstract.php | Class | Abstract class that provides API for managing Nested set database table. |
Exception.php | Class | Exception in NestedSetDbTable package |
nested-set-db-table-2012-08-17.zip 18KB | |
nested-set-db-table-2012-08-17.tar.gz 16KB | |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
0% |
|
|
User Comments (1) | |||||
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.