2017 © Pedro Peláez
 

library data

Persistence simplified

image

respect/data

Persistence simplified

  • Friday, January 30, 2015
  • by henriquemoody
  • Repository
  • 6 Watchers
  • 12 Stars
  • 5,973 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 6 Versions
  • 2 % Grown

The README.md

Respect\Data

Build Status Latest Version Total Downloads License, (*1)

Respect\Data allows you to use multiple, cooperative database mapping with a single solid API. You can even mix out MySQL and MongoDB databases in a single model., (*2)

This project is a work in progress, (*3)

Installation

The package is available on Packagist. You can install it using Composer., (*4)

composer require respect/data

PSR-0 and PSR-2 compatible., (*5)

Collections

The main component for Respect\Data are Collections. They define how data is grouped in your application., (*6)

In the example below, we're declaring two collections for dealing with a news portal:, (*7)

$articles = Collection::article();
$authors = Collection::article()->author();

Backends

Currently, Respect\Data has two planned backend implementations: Respect\Relational for relational databases like MySQL and SQLite and Respect\Structural for MongoDB databases. These are different mappers that use the Respect\Data model., (*8)

Below is a sample of how to retrieve all authors from the author 5:, (*9)

$mapper->article->author[5]->fetchAll();
  • On the Relational backend, Respect would automatically build a query similar to SELECT * FROM article INNER JOIN author ON article.author_id = author.id WHERE author.id = 5.
  • On the Structural backend for MongoDB, the generated internal query would be something like db.article.find({"author.id":5}, {"author":1});.

Features

Besides fetching data from databases, Respect\Data is expected to deal with several other scenarios:, (*10)

  • Persisting data into collections
  • Using backend-native extra commands in queries
  • Declaring shortcuts for large collection declarations
  • Handling composite mapper backends

License

See LICENSE file., (*11)

The Versions

30/01 2015

dev-master

9999999-dev http://respect.li/

Persistence simplified

  Sources   Download

BSD Style

The Requires

  • php >=5.3.0

 

The Development Requires

by Alexandre

05/01 2015

0.2.2

0.2.2.0 http://respect.li/

Persistence simplified

  Sources   Download

BSD Style

The Requires

  • php >=5.3.0

 

The Development Requires

by Alexandre
by Rogerio Prado de Jesus
by Augusto Pascutti
by Nick Lombard

14/02 2013

0.2.1

0.2.1.0

Persistence simplified

  Sources   Download

BSD Style

by Alexandre
by Rogerio Prado de Jesus
by Augusto Pascutti
by Nick Lombard

12/02 2013

0.2.0

0.2.0.0

Persistence simplified

  Sources   Download

BSD Style

by Alexandre
by Rogerio Prado de Jesus
by Augusto Pascutti
by Nick Lombard

18/12 2012

0.1.7

0.1.7.0 https://github.com/Respect/Data

Persistence simplified.

  Sources   Download

BSD-3-Clause

by Augusto Pascutti
by Alexandre Gomes Gaigalas

database persistence respect

17/12 2012

0.1.6

0.1.6.0 https://github.com/Respect/Data

Persistence simplified.

  Sources   Download

BSD-3-Clause

by Augusto Pascutti
by Alexandre Gomes Gaigalas

database persistence respect