Download the PHP package allegiance-group/nested-set without Composer

On this page you can find all versions of the php package allegiance-group/nested-set. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package nested-set

metalinspired\NestedSet v2

Introduction

This is a fork of the repository by metalspired found at https://github.com/metalinspired/NestedSet. This was created to apply the following patches: (Find nested set node id by custom data)[https://github.com/Beaconfire/NestedSet/commit/f52319a30c295fb1bc373a260aeaf50a59c21235.patch] (Prevent warnings in Drupal admin)[https://github.com/Beaconfire/NestedSet/commit/75367158584e16c0e5612159f16703c64c8fa2ae.patch]

This library allows you to manipulate and retrieve database records using nested set model technique to represent tree data structure. It uses Laminas\Db as underlying database abstraction layer.

Requirements

Installation

Usage

(Hybrid) Nested Set

Nested Set requires only left and right columns in table to represent a tree structure. Hybrid Nested Set requires additional parent, ordering and depth columns. This addition makes manipulation more complex but greatly simplifies retrieval of nodes. For example, in order to find siblings of a node we simply query for nodes with same parent, instead of using join to find parent and join to get parent's immediate descendants. Ordering column is used to represent natural order of nodes.

Config object

Config class, as name suggests, is used to create an object with predefined configuration for manipulation/selection classes in this utility, and you do so by changing values of its public members. It also has three static methods that create instance of Config object and set its $adapter member to an Laminas\DB\Adapter\Driver instance.

Example:

Manipulation

Manipulate classes contain methods for creating (inserting), moving and deleting nodes in nested set model. It also has createRootNode method that creates a root node that serves as a container for all other nodes.

Example:

Manipulation methods, excluding insert, can also accept array of node identifiers as their first argument, meaning you can move, delete and clean multiple nodes with just one call.

Example:

HybridManipulate class has extra method named reorder. It allows you to move a node within its parent by using order column value as destination instead of node identifier.

Retrieving records

Find classes contain methods for retrieving records and their names pretty much explain what they do. All you need is to provide them with node identifier ($id argument), all other arguments are options. For arguments list please refer to each function source;

Each of these methods have an (almost) equal get*Query method (for example getFindAncestorsQuery) which returns Select object instead of ResultInterface. Unlike find methods these methods do not take identifier as argument but instead define an :id placeholder. For usage example simply look at one of find* methods.

Important note: Unlike $columns or $where arguments, when using $order argument you must match column names with table t (t is an alias for table you are querying), for example:

Factory

Factory encapsulates find and manipulate classes of NestedSet and HybridNestedSet in one class.


All versions of nested-set with dependencies

PHP Build Version
Package Version
Requires php Version ^5.6 || ^7.0 || ^8
laminas/laminas-db Version ^2.8
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package allegiance-group/nested-set contains the following files

Loading the files please wait ....