adamquaile/json-object-mapper
Composer 安装命令:
composer require adamquaile/json-object-mapper
包简介
Maps JSON files to PHP objects, intended for simple model separation and manual content authoring
README 文档
README
Small library to read JSON files from a directory and turn them into PHP objects. Designed for simple content authoring and model separation by developers without the need for a whole DBMS.
Not intended as any kind of DBMS, or application writable persistence layer
Main Features
- Small / simple query API
- Can either map to objects you define, or use default provided (behaviour similar to
stdClass)
Installation
composer require adamquaile/json-object-mapper
Usage
Full documentation here
<?php
require __DIR__.'/vendor/autoload.php';
$manager = new \AdamQuaile\JsonObjectMapper\EntityManager('/path/to/storage');
// Either
$book = $manager->find('books/1984');
$book->isbn;
$book->getTitle(); // etc
// or
$books = $manager->findAll('books');
$books[0]->isbn
$books[0]->getTitle() // etc
// or
$books = $manager->findAll('books', $manager->query()->matches('author.name', '/george/i'));
$books[0]->getTitle() // etc
统计信息
- 总下载量: 58
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 11
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2013-12-29