Download the PHP package legomolina/simple-orm without Composer

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

SimpleORM

SimpleORM is a little object-relational mapping library written in PHP. This ORM fits me perfect but probably is too small for your projects so you can fork it and improve it or send me a pull request so I can merge changes :D

Installation

SimpleORM is hosted in packagist so you can get it from Composer

Configure

Require the Composer autoload in your index:

Create your first model:

Call config method from Model to pass mysqli connection params

And you are ready to use SimpleORM!

Usage

Quick access methods

SimpleORM has quick select methods to agilize common queries. If you want to select all from your table you don't need to type

Just use method from :

Also you can find the last value of any field of your table simply calling from :

This is useful when you need the last id of your table to insert a new register when not using autoincrement.

Finally you can retrieve the register with n id with from :

Select queries (See quick access)

If you want to select all data from your table.

If you want to add conditions. This creates a simple where (WHERE field operator value)

If you want some conditions you can join them with AND (WHERE field operator value AND field_2 operator_2 value_2).

Join them with or (WHERE field operator value AND field_2 operator_2 value_2)

If you want to combine both (WHERE (field operator value AND field_2 operator_2 value_2) OR (field_3 operator_3 value_3))

Also you can check for NULL values (WHERE field IS NULL)

Or you can negate (WHERE (field operator value) OR NOT (field_2 operator_2 value_2))

If you don't want to select all fields.

If you want to order results by any field.

If you want to limit the results returned.

Data manipulation

If you want to insert values.

If you want to delete items.

If you want to update items.

Working with ResultSet

ResultSet is a handler class for Select queries. It allows you to loop through results, find value or checks if exists some field.

Getting values from result

Easiest way doing this is with ResultSet->loop() method inside while loop.

ResultSet->loop() loops through all registers in the ResultSet and each iteration it loads next register values.

You can also go to n register executing

Or you can loop manually with

You can check manually if the current register is the first or the last.

Search for a value

With ResultSet you can search for a specific value in all results from database and return the register it belongs to.

Also you can know if a field exists.

And finally you can search a value from ALL registers. It will return the first register that founds with this value

License

SimpleORM is licensed under the MIT license. See License File for more information.


All versions of simple-orm with dependencies

PHP Build Version
Package Version
Requires php Version >=7.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 legomolina/simple-orm contains the following files

Loading the files please wait ....