mtoolkit / mtoolkit-model
The model module of MToolkit framework
Installs: 39
Dependents: 3
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/mtoolkit/mtoolkit-model
Requires
- php: >=5.3.0
- mtoolkit/mtoolkit-core: 0.0.3
Requires (Dev)
- phpunit/phpunit: 5.1.*
This package is not auto-updated.
Last update: 2025-09-26 19:26:38 UTC
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();