|Last Updated|| ||Ratings|| ||Unique User Downloads|| ||Download Rankings|
|2017-07-23 (1 hour ago) ||Not yet rated by the users||Total: 244 This week: 1||All time: 7,579 This week: 650|
This package can map objects to databases records using annotations.
It provides base classes that can store and retrieve objects from database tables. The base classes should be extended by implementation classes.
The object-relational mapping information is extracted from annotation comments read from the implementation classes as well using PHP reflection. So it is possible to map complex datatypes such as DateTime into database column datatypes seamlessly.
The ORM classes provide means to retrieve, store and remove objects from the configured database tables. It supports MySQL, Postgresql and SQLite using PDO.
It supports objects that reference other objects, allowing to save also the referenced objects when a given object is saved if the relationship is set to @cascade.
The package also supports mapping classes to existing database tables using the attributes @id, @table and @column to define class mapping to legacy tables.
|Annotations are useful information that can be added to classes to perform other tasks besides running the class code.
This package implements object-relational mapping that reads information about the mappings from annotation comments in the class code. It can work to map objects to existing legacy database tables.
An annotation-based PHP Object Relational Mapper
This project aims to be an object relational mapper easy to use. The main target is to support developers writing only simple attribute containing classes and store it as entities into a database.
It has support for annotations so it is very flexible.
Here is a very basic example about the usage (for sqlite):
CREATE TABLE super_duper_content (id INTEGER PRIMARY KEY, content TEXT);
* @table super_duper_content
class SuperDuperEntity extends AbstractModel
* @column id
public function setSid($sid)
$this->sid = $sid;
public function getSid()
public function setContent($content)
$this->content = $content;
public function getContent()
/First configure the ORM/
'type' => 'sqlite',
'file' => ':memory:'
// Create sqlite database table for memory storage
// Orm::getInstance()->getConnection()->exec("CREATE TABLE super_duper_content (id INTEGER PRIMARY KEY, content TEXT)");
/Now create a new entity and persist it to database/
$entity = new SuperDuperEntity();
$entity->setContent("Mega important content");
/First read the entity from database/
$entity = SuperDuperEntity::find(array('content' => "Mega important content"));
/Display the content/
No need to write infrastructure and boilerblate code by yourself. Let the Orm do the hard work for you.
Caribu provides a convention-over-configuration behaviour by supporting annotations.
See the Wiki for more information about the capabilities and usage.
||Applications that use this package
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.