yaophp/orm
Composer 安装命令:
composer require yaophp/orm
包简介
An orm lib independence from thinkphp 5.1.0RC1
README 文档
README
An orm lib independence from ThinkPHP
update to 5.1.0 RC1
Installation
git clone then composer install
or
composer require yaophp/orm
Usage
Demo.php
<?php require "vendor/autoload.php"; use yaophp\Orm; use think\Db; use think\Model; //your database config, more info in orm/src/config.php Orm::config([ 'username' => 'yourusername', 'password' => 'yourpassword', 'database' => 'yourdatabase' ]); //example 1: var_dump(Db::query('select * from article where id = :id', ['id' => 1])); //example 2: // from 5.1.0 RC1 where expression not support array type // var_dump(Db::name('article')->where(['id' => 1])->find()); // wrong var_dump(Db::name('article')->where('id', '=', 1)->find()); // right //example 3: //do not use the way "\think\Loader::model()" to get an instance of Model class Article extends Model { public function getId($id) { return $this->where('id', '=', 1)->find(); } } $article = new Article(); var_dump($article->getId(1));
link
ThinkPHP (https://www.kancloud.cn/manual/thinkphp5_1/353997)
统计信息
- 总下载量: 25
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 13
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2017-02-28