Download the PHP package tabusoft/orm without Composer

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

Tabusoft/ORM

Tabusoft/ORM is an entity and relationship manager.

Installation

You can install it with composer

Use the entity manager

To use the entity manager we must create all entities and repository. The meaning of those two words will explain in the next paragraph. We have two command lines utilities: orm-cli and create-config.

Create the config.json

create-config could be use to create a config.json files to use as parameter for orm-cli.

You may specify a lot of config options. Please read the help:

Create the enities

The entities object are a 1 to 1 description of DB's table or collection. The class ar stored in the selected namespace under the "Entities" directory. Entities classes use a Trait that contains all the properties and setters and getters. Repository are use to manage the DB persistance and are stored in the selected namespace under the folder Repositories. Repositories classes use a Trait that contains all the info to grant the persistence.

To create these files you can use: orm-cli

To only update "Descriptors" without change the user edited Entities

Entities restrictions

Some tips to create your tables on MySQL DB.

Use the entities

For example you will create these enities: (will be used in the below examples)

Init the entitity

tabusoft/orm use massively tabusoft/db in the factory configuration you need to provide the same configuration of the tables. Please refer to the documentation of that package.

You can instantiate like an object:

Or you can retrieve it from db:

Save (insert or update) the entity

The entity manager use a MySQL REPLACE command to insert or update the row in the DB. You can simply change your Entity properties and save it throw his repository.

If you are saving a new Category object you must fill all non-nullable columns. Otherwise you will get an \Exception.

Lazy load

When you don't need performance you can use the foreign keys relations simple invoke the object. In the next example we have a relation from ForumTopics and ForumCategory. The lazy method appears directly in the entity descriptor.

Every time you call the getForumCategory() method you have a query. The result will be cached. Take care if you will use multiple requests.

Use the query builder

EQB is the Entity Query Builder. Give you the possibility to make queries without (if you want) enter to deeply into the DB structure. It have 3 special class: the EQB::Entity, the EQB::Column, the EQB::Function.

The entities

Wrap the Entities classes to one that could use into your query.

The columns

Maps the property to the columns. If you'll use a single column into the select you must specify the alias.

The functions

Maps the MySQL properties to the class utilities. If you'll use it in the select statement you need to specify an alias.

Putting all together: the query

The EQB object is the equivalent of the SQL query.

Simple select

Let's put all togheter:

Full explained JOIN

To make a join:

MySQL functions

Fast Join

As said we are mapping the foreign keys relation. In this mode we can create simple join. For each join will be search the related entity in the from and previus join. If there is no relation we search in the opposite direction. In that case first relation win.


All versions of orm with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4
tabusoft/db Version ^1.0
tabusoft/cli-manager Version ^1.0
jdorn/sql-formatter Version ^1.0
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 tabusoft/orm contains the following files

Loading the files please wait ....