utipd/mysqlmodel 问题修复 & 功能扩展

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

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

utipd/mysqlmodel

Composer 安装命令:

composer require utipd/mysqlmodel

包简介

A minimalistic manager for storing and retrieving MySQL rows as PHP models. Does not handle schemas. Does allow treating mysql rows like documents.

README 文档

README

A MysqlModel component for UTipdMe.

Build Status

A simple ORM to map MySQL table rows to PHP models and back.

Usage Example:

<?php 

// create a class
//   this maps to table user in MySQL (you must create this yourself)
class UserDirectory extends \Utipd\MysqlModel\BaseDocumentMysqlDirectory {

    protected $column_names = ['email'];

}

// pass in your PDO object
$user_directory = new UserDirectory(new \PDO('mysql:dbname=testdb;host=127.0.0.1'));

// find by email
$user = $user_directory->findOne(['email' => 'johny@appleseed.com']);

// access rows and properties
print $user['email']."\n";

// update in MySQL, adding arbitrary columns
$user_directory->update($user, ['firstName' => 'John', 'lastName' => 'Appleseed']);

// get the user again from the database
$user = $user_directory->reload($user);
print $user['firstName']." ".$user['lastName']."\n";

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-07-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固