定制 siriusphp/orm 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

siriusphp/orm

Composer 安装命令:

composer require siriusphp/orm

包简介

Powerfull and fast PDO-based data mapper

README 文档

README

Source Code Latest Version Software License Build Status Coverage Status Quality Score

Sirius ORM is a fast and lightweight yet flexible data mapper solution developed with DX in mind. It offers:

  1. Mapping rows to your own entities
  2. Relations and relation aggregates (COUNT/AVERAGE)
  3. Eager-loading & lazy-loading (without increasing the number of queries)
  4. Queries that let you JOIN with relations (not tables)
  5. Deep persistence
  6. Dynamically defined mappers
  7. Speed & low memory usage (no Entity Manager)
  8. 90+% code coverage

Installation

composer require siriusphp/orm

Initialization

use Sirius\Orm\Orm;
use Sirius\Orm\ConnectionLocator;
$connectionLocator = ConnectionLocator::new(
    'mysql:host=localhost;dbname=testdb',
    'username',
    'password'
);
$orm = new Orm($connectionLocator);

Configuration

AKA, registering mappers and relations

$orm->register('pages', MapperConfig::fromArray([
    /**
     * here goes the configuration 
     */
]));

// continue with the rest of mappers

Usage

// find by ID
$page = $orm->find('pages', 1);
// or via the mapper
$page = $orm->get('pages')->find(1);

// query
$pages = $orm->select('pages')
             ->where('status', 'published')
             ->orderBy('date desc')
             ->limit(10)
             ->get();

// manipulate
$page->title = 'Best ORM evah!';
$page->featured_image->path = 'orm_schema.png';

// persist
$orm->save($page);
// or via the mapper
$orm->get('pages')->save($page);

Links

统计信息

  • 总下载量: 46
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 13
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 13
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-02-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固