A simple PHP ORM based on reflection
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 1 commit behind fernandomantoan:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
test
.gitignore
LICENSE
README.md

README.md

metaORM

A simple PHP ORM based on Reflection API. The API and the main features are very simple and limited, so you should use it if your project doesn't have complex requirements. If that's the case there are full featured ORMs available for PHP like Doctrine ORM.

Usage

You can define your entities with public attributes

<?php
  
namespace Entity;
  
class Person
{
  public $id;
  public $name;
}

Then you initialize the ORM and operate through its methods.

<?php
  
$orm = new ORM\ORM();
$person = new Entity\Person();
$person->name = 'Test';
$orm->insert($person);

You can find all data.

$people = $orm->findAll('person');
  
foreach ($people as $person) {
  var_dump($person->name);
}

License

Copyright 2013 Fernando Geraldo Mantoan

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.