Download the PHP package stratadox/table-loader without Composer

On this page you can find all versions of the php package stratadox/table-loader. 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 table-loader

Table Loader

Build Status Coverage Status Scrutinizer Code Quality Infection Minimum PhpStan Level Maintainability Latest Stable Version License

Installation

Install using composer require stratadox/table-loader

What is this?

The TableLoader package is designed to transform the result of a select query into objects. It solves the challenge of deserialising joined table rows into objects without duplicating the entities.

To load a table means to produce objects from the associative arrays that result from a SQL query.

An object that LoadsTables can make interrelated objects from a list of associative arrays.

Table loading works closely together with the Hydration modules to easily integrate with mapped hydration and lazy- and extra lazy loading.

What does it do?

The purpose of the TableLoader package is to transform SQL-like table results into a set of objects.

Connecting eagerly loaded relationships

When eagerly loading a relationship from a SQL database, one generally performs some kind of JOIN query.

The TableLoader package provides several options for converting the joined result into interconnected objects.

Each entity can be given any number of has-one and/or has-many relationships. Bidirectional associations can be produced by assigning such relationships to both sides.

Any number of tables can be joined at a time. Self-referencing joins are equally supported.

Mapping concrete subclasses

When dealing with polymorphism in a SQL schema, objects are generally mapped in either of three ways:

The TableLoader supports any of these methods, so long as a decision key is provided. (Also known as discriminator column)

Managing identities

It can happen that some of the objects have already been loaded by a previous query.

For example, let's assume we're first loading only employee X. Later on we're fetching company Y with all employees - including employee X.

While we do want company Y to include employee X on the books, we do not want two copies of employee X in memory.

To solve this challenge, loaded entities are added to an Identity Map. The table loader consults the identity map when extracting an entity from the table row data. A new entity is only produced if it was not already present in the map.

If employee X had a lazy has-one mapping to their company, the company relation was a Proxy when the employee was first loaded. By loading the company Y, and its eager has-many employees mapping, the real company Y is automatically loaded into the relationship that previously held a proxy.

Usage Samples

Simple result without (eager) relations:

Assuming for table:

Unidirectional has-many mapping:

Bidirectional has-many mapping:

Many-to-many relationship:

Multiple joined tables:

To do


All versions of table-loader with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
stratadox/instantiator Version ^0.1.0
stratadox/immutable-collection Version ^1.1
stratadox/hydration-mapper Version ^2.4
stratadox/identity-map Version ^0.5
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 stratadox/table-loader contains the following files

Loading the files please wait ....