Download the PHP package gigorok/php-orm without Composer

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

=============================

The open source ORM library on PHP.

Introduction

The PHP-ORM follows ActiveRecord architectural pattern.

More details can be found here.

Minimum Requirements

Supported Databases

Features

Installation

Use composer to install PHP ORM library. Just add to your composer.json a text below and run the php composer.phar update command to install it:

{
    "require": {
        "gigorok/php-orm": "0.2.*"
    }
}

Basic CRUD

Retrieve

These are your basic methods to find and retrieve records from your database.

$post = Post::find(1);
echo $post->title; # 'Test title!'
echo $post->author_id; # 5

# also the same since it is the first record in the db
$post = Post::first();

# finding using a conditions array
$posts = Post::where('name=? or id > ?', array('The Bridge Builder', 100));

Create

Here we create a new post by instantiating a new object and then invoking the save() method.

$post = new Post();
$post->title = 'My first blog post!!';
$post->author_id = 5;
$post->save();
# INSERT INTO `posts` (title,author_id) VALUES('My first blog post!!', 5)

Update

To update you would just need to find a record first and then change one of its attributes.

$post = Post::find(1);
echo $post->title; # 'My first blog post!!'
$post->title = 'Some real title';
$post->save();
# UPDATE `posts` SET title='Some real title' WHERE id=1

$post->title = 'New real title';
$post->author_id = 1;
$post->save();
# UPDATE `posts` SET title='New real title', author_id=1 WHERE id=1

Destroy

Deleting a record will not destroy the object. This means that it will call sql to delete the record in your database but you can still use the object if you need to.

$post = Post::find(1);
$post->destroy();
# DELETE FROM `posts` WHERE id=1
echo $post->title; # 'New real title'

License

Licensed under the MIT license.


All versions of php-orm with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
gigorok/inflector Version 0.1.*
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 gigorok/php-orm contains the following files

Loading the files please wait ....