Git Product home page Git Product logo

php-orm's Introduction

RsORM

Build Status

Overview

It is simple ORM library for PHP. This library is compatible with PHP 5.4 and higher. There are no magic methods. All code is type-hinted. It could be used in high load projects even with partitioning and sharding. There are 3 basic parts (packages). You could combine them or use some of them separately.

  • State package — responsible for object state management. Prepares data for usage in DB queries.
  • Query package — query builder. It could use data from State package or any other sources.
  • Driver package — sends queries to database and parses results.

Quick Start

Typically you can combine these 3 packages or use them alone. And at first you should define class of entity you work with. This class structure convenient to build accordingly with DB table structure.

class Account extends State\Entity {
	public $id;
	public $email;
	public $password;
}

Then you can build MySQL query. For example, select statement.

$statement = Query\Engine\MySQL\Builder::select()
	->table("accounts")
    ->build();

And then you can execute this statement and get result (array of defined class objects).

$mysql = new Driver\MySQL();
$accounts = $mysql->fetchAllClass($statement, "Account");
/*
$accounts - array of Account objects, like this:
[
	{id: 1, email: "[email protected]", password: "123456"},
	{id: 2, email: "[email protected]", password: "654321"},
	...
]
*/

It is simple example of usage RsORM. More detailed information you can find in the relevant sections.

Documentation

State package
Query package
Driver package

License

Released under the MIT License.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.