A data store designed to allow the use of any data technology:
- File system
- SQL
- MongoDB
This will allow you to design data driven applications with models that are not specific to the source of data.
Have your data models extend Model
:
<?php
class Person extends \Transport\Model
{
}
Configure your connection:
<?php
$store = new \Transport\Store();
$store->config("mongodb://localhost/my_db");
-
::find($query=null)
aliases: where - Find and return a set of records based on a query. -
::find_by_$prop($query=null)
- Directly query a proprty. -
->filter($query=null)
- aliases: find() where() - Filter a result. -
::first($query=null)
- Run a query and return the first element. -
::last($query=null)
- Run a query and return the last element. -
->first()
- Return the first element of a data cursor. -
->last()
- Return the last element of a data cursor. -
->sort()
aliases: order() - Sort the elements of a data cursor. -
->sort_by_$prop()
aliases: order_by_$prop() - Sort the elements of a data cursor directly by a property. -
->limit()
- Only allow a set number of results. -
->destroy()
- Destroy an instance of a record. -
::new($attributes = array())
- Create a record. -
->update_attributes($attributes=array())
- Update an existing record's attributes. -
->save()
- Save a record.
create
before/aftersave
before/afterupdate
before/afterdestroy
before/after