{"repo":"Rundiz/nested-set","free":true,"listed":false,"github":"https://github.com/Rundiz/nested-set","clone":"git clone https://github.com/Rundiz/nested-set.git","description":"The PHP nested set model for create/read/update/delete the tree data structure (hierarchy).","language":"PHP","stars":34,"topics":["nested-set","nested-structures","hierarchy","taxonomy","database"],"license":"MIT","category":"databases-storage","readme_excerpt":"NestedSet The PHP nested set model for create/read/update/delete the tree data structure (hierarchy). A class that help you to query complex data of nested set. Tested up to PHP 8.5. Example Install I recommend you to install this library via Composer and use Composer autoload for easily include the file. If you are not using Composer, you have to manually include the file by yourself. Please make sure that the path to files are correct. If you want to make sure or see how class is working please following the step below, otherwise skip this step. Import tests/common/test-database-structure.sql file to the database. --- Connect to DB This class is using PDO class. Please connect to PDO and send the \\PDO object to the class constructor. --- Insert the data Before insert, you can get new position of that taxonomy level using getNewPosition() method. Everytime you insert the data, you have to run rebuild() method to generate level, left, right data. The incorrect level, left, right data can cause incorrect listing. --- Update the data To update the data, you don't need new position for this but you have to run rebuild() method every time. Check parent under children If you want to change the parent of selected item, you can check first that the new parent of selected item is under children of selected item or not. You can use isParentUnderMyChildren() method to check this and false means correct parent (new parent is not children of editing item). To continue on this please use ","default_branch":null,"files":null,"tree":[],"storefront":"/r/Rundiz","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Rundiz/nested-set/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}