respect/data 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

respect/data

Composer 安装命令:

composer require respect/data

包简介

Persistence simplified

README 文档

README

Latest Version Total Downloads License

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.

This project is a work in progress

Installation

The package is available on Packagist. You can install it using Composer.

composer require respect/data

PSR-0 and PSR-2 compatible.

Collections

The main component for Respect\Data are Collections. They define how data is grouped in your application.

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

$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.

Below is a sample of how to retrieve all authors from the author 5:

$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:

  • 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.

统计信息

  • 总下载量: 21.81k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 15
  • 点击次数: 2
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 13
  • Watchers: 7
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: BSD
  • 更新时间: 2012-01-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固