mtoolkit/mtoolkit-model
Composer 安装命令:
composer require mtoolkit/mtoolkit-model
包简介
The model module of MToolkit framework
README 文档
README
The model module of MToolkit framework.
Summary
#Intro The module provides the classes to represent x-dimensional models, as list or table. There are a submodule about the sql models: to run a query, to retrieve a resultset, etc...
MDbConnection
It provides a simple singleton way to store the connection to the database. Usages:
// Add a new connection string MDbConnection::addDbConnection( new \PDO( 'mysql:host=127.0.0.1;dbname=test_db', 'root', 'password' ) ); // Retrieve the database connection $connection = MDbConnection::getDbConnection();
MPDOQuery and MPDOResult
Usages:
$query = "SELECT item_01 FROM table_01"; $connection = MDbConnection::getDbConnection(); $sql = new MPDOQuery( $query, $connection ); $sql->bindValue( $key ); $sql->exec(); $result = $sql->getResult();
统计信息
- 总下载量: 39
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: LGPL-3.0
- 更新时间: 2016-01-18