Download the PHP package asko/orm without Composer

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

ORM

codecov

A object relational mapper with a query builder and out of box support for MySQL databases.

Installation

Set-up

To start with create your base model class that your actual data models will be extending, like so:

And then you can create all your data models like this:

And woalaa, you have an ORM mapping data classes to tables in the database all with full type support (works especially well with PHPStan).

Note that the $_identifier should match the name of the primary key column, which in the above case is id, and the $_table should match the name of the database table, naturally. The other properties here represent the columns of the table, these will be populated by the ORM automatically when querying data and have to have the Column attribute.

Querying

You can query for data using the numerous query builder methods built into ORM.

An example query looks like this:

Although because we use the primary key identifier to search for the user, the above could be simplified as:

All query methods

where

Where clause to filter the results.

Usage:

andWhere

Same as where but with AND operator.

Usage:

orWhere

Same as where but with OR operator.

Usage:

orderBy

Order the results by a column.

Usage:

limit

Limit the number of results.

Usage:

offset

Offset the results.

Usage:

join

Join another table.

Usage:

leftJoin

Join another table with a left join.

Usage:

rightJoin

Join another table with a right join.

Usage:

innerJoin

Join another table with an inner join.

Usage:

outerJoin

Join another table with an outer join.

Usage:

raw

Add a raw SQL to the query.

Usage:

get

Get all the results.

Usage:

first

Get the first result.

Usage:

last

Get the last result.

Usage:

Creating

To create a new record in the database, you can do the following:

Updating

To update a record in the database, you can do the following:

Deleting

To delete a record in the database, you can do the following:

Creating a connection driver

ORM comes with the MySQL driver already built in, but if you wish to extend the ORM to support other databases, you can do so by creating a new driver class that implements the ConnectionDriver interface, and if you need to also build a new query builder due to syntax differences with the MySQL query builder, you can do so by creating a new query builder class that implements the QueryBuilder interface.


All versions of orm with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
crell/fp Version ^1.0
asko/collection Version ^1.0
ext-pdo Version *
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 asko/orm contains the following files

Loading the files please wait ....