Download the PHP package lumax/aurora-db without Composer

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

Luma | Aurora DB

Version 2.7.3 PHP Coverage 89.67% License GPL--3.0--or--later

The small but mighty PHP database component.

Installation

Usage

In your applications entrypoint, connect to your database:

In its simplest form, we can use the above DatabaseConnection instance to get the PDO database connection:

This allows you to use Aurora models to interact with your database via a single shared connection.

The Aurora Model

Create Database Tables

An Aurora model is an entity that is specifically designed to interact with a corresponding database table. One instance of an Aurora model relates to one row in its corresponding database table.

Take the following tables:

Create Aurora Classes

We can create the following Aurora models which will allow us to create, retrieve, update and delete records within these tables.

All Aurora models have a getId() method which returns the value of the property with the #[Identifier] attribute. Identifiers must be protected and are required as part of a valid Aurora model. All other properties which you also wish to map to a database column should use the #[Column($name)] attribute.

Nullable Columns

If your database table contains any nullable columns it is important to ensure that the associated property has been type hinted as nullable:

OneToMany Relationships

For handling one-to-many relationships, for example fetching all Article models created by a User, we can add a property to hold our articles (on the User model):

It's as simple as that, now calling getArticles() from a User instance will return a Collection containing all the articles written by that user.

Table & Schema

By default, the table name associated with your Aurora class will be the same name as your class - so User and Article in this case. In addition, no schema will be set for your class - output queries will look something like this SELECT * FROM User ....

You may wish to specify a schema and table name:

This would create/run queries that look something like this SELECT * FROM Core.User ....

CRUD Methods

Let's add some new records to the tables we created:

And we can retrieve them:

The save() method can also be used to update existing records:

And we can also delete existing records:

Pagination

Aurora also allows you to paginate your data:

Query Builder

The Aurora model includes a handy query builder. Some important notes:

In order to execute any query builder statement and retrieve the results, you must call the get method.

All query builder results are returned with the specified columns as well as their primary identifier, so this does not need to be specified.

There are 3 possible return types following a get() call:

  • When one result is returned, this returns as an instance of the calling class.
  • When more than one result is returned, this returns an array containing instances of the calling class.
  • When zero results are returned, NULL is returned by the query builder.

Here are some of the methods that you can use:


All versions of aurora-db with dependencies

PHP Build Version
Package Version
No informations.
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 lumax/aurora-db contains the following files

Loading the files please wait ....