2017 © Pedro Peláez
 

library torm

An ORM based on ActiveRecord

image

taq/torm

An ORM based on ActiveRecord

  • Thursday, February 1, 2018
  • by taq
  • Repository
  • 19 Watchers
  • 73 Stars
  • 286 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 31 Forks
  • 1 Open issues
  • 16 Versions
  • 11 % Grown

The README.md

TORM

:warning: WARNING This software is abandonware. As the creator and maintainer, I don't even use PHP for years, so, I can't support it anymore. It should work ok for PHP untill version 7, but seems that with 8.1 there are some alerts. Feel free to fork it and keep it going.

Just another simple ORM for PHP. You can use it, but don't ask why I made it. Right? :-), (*1)

Usage

Take a look on the Github Wiki for documentation, but let me show the basics here:, (*2)

 true]);
User::validates("email", ["presence"     => true]);
User::validates("email", ["uniqueness"   => true]);
User::validates("id",    ["numericality" => true]);

// create some relations
User::hasMany("tickets");
User::hasOne("account");
Ticket::belongsTo("user");

// this will create a new user
$user = new User();
$user->name  = "John Doe";
$user->email = "john@doe.com";
$user->level = 1;
$user->save();

// this will find the user using its primary key
$user = User::find(1);

// find some users
$users = User::where(["level" => 1]);

// find some users, using more complex expressions
// the array first element is the query, the rest are values
$users = User::where(["level >= ?", 1]); 

// updating users
User::where(["level" => 1])->updateAttributes(["level" => 3]);

// using fluent queries
$users = User::where(["level" => 1])->limit(5)->order("name desc");

// listing the user tickets
foreach($user->tickets as $ticket) {
   echo $ticket->description;
}

// show user account info
echo $user->account->number; 
?>

Testing

SQLite

First, use composer update to make sure everything is ok with all the packages. Then, go to the test directory and run run. It will requires the SQLite driver so make sure it is available. If not, check the php.ini dir found with, (*3)

$ php -r 'phpinfo();' | grep 'php.ini'
Configuration File (php.ini) Path => /etc/php/7.1/cli
Loaded Configuration File => /etc/php/7.1/cli/php.ini

and, if not found there or on the conf.d on the same location the php.ini file is, it can be installed, on Ubuntu, using:, (*4)

$ sudo apt install php-sqlite3

Multibyte strings, locale and YAML

$ sudo apt install php-mbstring php-intl php-yaml

The Versions

01/02 2018

dev-master

9999999-dev http://github.com/taq/torm

An ORM based on ActiveRecord

  Sources   Download

GPL GPL-2.0-or-later

The Requires

 

orm database activerecord

01/02 2018

1.3.3

1.3.3.0 http://github.com/taq/torm

An ORM based on ActiveRecord

  Sources   Download

GPL-2.0-or-later

The Requires

 

orm database activerecord

31/01 2018

1.3.2

1.3.2.0 http://github.com/taq/torm

An ORM based on ActiveRecord

  Sources   Download

GPL-2.0-or-later

The Requires

 

orm database activerecord

03/02 2017

1.3.1

1.3.1.0 http://github.com/taq/torm

An ORM based on ActiveRecord

  Sources   Download

GPL

The Requires

 

orm database activerecord

18/09 2016

dev-postgresql

dev-postgresql http://github.com/taq/torm

An ORM based on ActiveRecord

  Sources   Download

GPL

The Requires

  • php >=5.3.0

 

orm database activerecord

03/04 2016

1.2.7

1.2.7.0 http://github.com/taq/torm

An ORM based on ActiveRecord

  Sources   Download

GPL

The Requires

  • php >=5.3.0

 

orm database activerecord

08/01 2016

1.2.6

1.2.6.0 http://github.com/taq/torm

An ORM based on ActiveRecord

  Sources   Download

GPL

The Requires

  • php >=5.3.0

 

orm database activerecord

07/01 2016

dev-issue12

dev-issue12 http://github.com/taq/torm

An ORM based on ActiveRecord

  Sources   Download

GPL

The Requires

  • php >=5.3.0

 

orm database activerecord

06/01 2016

dev-issue11

dev-issue11 http://github.com/taq/torm

An ORM based on ActiveRecord

  Sources   Download

GPL

The Requires

  • php >=5.3.0

 

orm database activerecord

04/01 2016

1.2.5

1.2.5.0 http://github.com/taq/torm

An ORM based on ActiveRecord

  Sources   Download

GPL

The Requires

  • php >=5.3.0

 

orm database activerecord

23/11 2015

1.2.4

1.2.4.0 http://github.com/taq/torm

An ORM based on ActiveRecord

  Sources   Download

GPL

The Requires

  • php >=5.3.0

 

orm database activerecord

07/08 2015

1.2.3

1.2.3.0 http://github.com/taq/torm

An ORM based on ActiveRecord

  Sources   Download

GPL

The Requires

  • php >=5.3.0

 

orm database activerecord

09/07 2015

1.2.2

1.2.2.0 http://github.com/taq/torm

An ORM based on ActiveRecord

  Sources   Download

GPL

The Requires

  • php >=5.3.0

 

orm database activerecord

09/07 2015

1.2.1

1.2.1.0 http://github.com/taq/torm

An ORM based on ActiveRecord

  Sources   Download

GPL

The Requires

  • php >=5.3.0

 

orm database activerecord

09/07 2015

1.2.0

1.2.0.0 http://github.com/taq/torm

An ORM based on ActiveRecord

  Sources   Download

GPL

The Requires

  • php >=5.3.0

 

orm database activerecord

09/07 2015

1.1.9

1.1.9.0 http://github.com/taq/torm

An ORM based on ActiveRecord

  Sources   Download

GPL

The Requires

  • php >=5.3.0

 

orm database activerecord