Download the PHP package octacondeveloper/php-orm without Composer

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

PHP-ORM

This is a light weight ORM for core PHP applications that supports MySQL, Postgres and Sqlite database engine out of the box.

Badges

MIT License GPLv3 License AGPL License

Installation

Install PHP-ORM with composer

Env

Usage/Examples

Or You can use it as a Model Extension

Then in your class you can call the User Class with the Query methods

Documentation

PHP-ORM provides you with two distinct methods of interactions with methods. Which can be through

Query

This options allow to specify the table name directly while making the calls and it has several methods. A quick example of it usage is

Available methods

insert(array $data)

Create a new record into the selected table

insertBulk(array $data);

Insert bulk records at once

all();

Fetch all records on the table

first();

Fetch the first record on the table

last(string $column);

Fetch the last record on the datable, If a column is not provided, it would order it based on the primaryKey or based on the first availablecolumn on the table

rawQuery(string $sqlQuery);

This allows you to pass direct sql string to the Query instance

where(string $column, string $operand, string $value);

Add a query condition

andWhere(string $column, string $operand, string $value);

Add another compulsory query condition, this comes after an initial "where" method has been called

orWhere(string $column, string $operand, string $value);

Add another optional query condition, this comes after an initial "where" method has been called

orderBy(string $column, string $order);

Order records based on column either in ASC or DESC. Default order is ASC

count(string $column = null, string $value, string $operand);

Counts the number of records available on the table based on provided column and condition. If no parameters are passed, it count count the total records without any condition

max(string $column);

Get the maximum

min(string $column);

Get the minimum

update(array $data);

Update a record

delete();

Delete a record

begingTransaction();

Begin a transaction

commitTransaction();

Commit a transaction

rollbackTransaction();

Rollback a transaction

transaction($transaction);

Start a DB trabsaction session

withOne(string $table, string $foreignKey, string $primaryKey = 'id')

Fetch a one to one model relationship between two models

withMany(string $table, string $foreignKey, string $primaryKey = 'id')

Fetch a one to many model relationship between two models

Model

The Model approach allows you to create a class for your table and extends the model base class. This allows you to have other custom SQL related transaction in your class. It can used as follows:

Defining the table variable is optional. By default the Package gets your class name and assumes the corresponding table name to it. Take for example

Available methods

insert(array $data)

Create a new record into the selected table

insertBulk(array $data);

Insert bulk records at once

all();

Fetch all records on the table

first();

Fetch the first record on the table

last(string $column);

Fetch the last record on the datable, If a column is not provided, it would order it based on the primaryKey or based on the first availablecolumn on the table

where(string $column, string $operand, string $value);

Add a query condition

andWhere(string $column, string $operand, string $value);

Add another compulsory query condition, this comes after an initial "where" method has been called

orWhere(string $column, string $operand, string $value);

Add another optional query condition, this comes after an initial "where" method has been called

orderBy(string $column, string $order);

Order records based on column either in ASC or DESC. Default order is ASC

count(string $column = null, string $value, string $operand);

Counts the number of records available on the table based on provided column and condition. If no parameters are passed, it count count the total records without any condition

max(string $column);

Get the maximum

min(string $column);

Get the minimum

update(array $data);

Update a record

delete();

Delete a record

withOne(string $table, string $foreignKey, string $primaryKey = 'id')

Fetch a one to one model relationship between two models

withMany(string $table, string $foreignKey, string $primaryKey = 'id')

Fetch a one to many model relationship between two models

Method Chaining

The package allows method chaining as most of the methods wont return a result until it's chained to certian methods.

Authors

Contributing

Contributions are always welcome! This is an Open Source library and Pull Requests would be extremely welcome.


All versions of php-orm 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 octacondeveloper/php-orm contains the following files

Loading the files please wait ....