定制 taylor-hawkes/tays-orm 二次开发

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

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

taylor-hawkes/tays-orm

最新稳定版本:v1.0.2

Composer 安装命令:

composer require taylor-hawkes/tays-orm

包简介

Quick and easy ORM

README 文档

README

This is a super simple class for saving/editing record in a mysql database. It really helps for quickly/easily updating single records. #installation & usage

Install with composer:

composer require taylor-hawkes\easy-connect
composer require taylor-hawkes\tays-orm

Generate a new model with the generator script:

cd vendor/taylor-hawkes/tays-orm
php generate_model.php --table="users" --host="database_ip" --user="db_user" --pass="db_pass" --database="db_name" --table="tablename"

You can hard code the database params in the generate_table script so you don't have to put them in as params everytime.

This script by default installs all new Models and Base Models three directories up (in a TModel folder) from the TaysORM installation directory. You can edit where the script installs your Models.

Usage Examples:

Create a new user:

$user=new \TModel\Users();
$user->first_name="taylor";
$user->last_name="hawkes";
$user->save();

Edit a user:

$user=new \TModel\Users();
$user->fetchRow("1");// 1 is the value of the tables primary key
$user->last_name="Malone"; // I got married and was forced to take my wifes name
$user->save();

You can also fetch a row like this:

$user=new \TModel\Users();
$user->fetchRowWhere("first_name = 'taylor' and lastname ='hawkes'");
$user->last_name="Malone"; 
$user->save();

Selecting Multiple Records:

$user=new \TModel\Users();
$all_users= $user->fetchAssoc("select * from users");

All Other Queries:

$user=new \TModel\Users();
$do_something_else=$user->query("update users set ...");

Requirements

EasyConnect - [https://github.com/TaylorHawkes/EasyConnect]

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-11-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固