Update 'src/ORM/DBInstance.php'

This commit is contained in:
ahwelp
2020-04-16 02:03:00 +00:00
parent e48d5a8992
commit 35b4be28d1
+27 -1
View File
@@ -22,6 +22,9 @@ class DBInstance {
* Execute * Execute
* *
* This method will execute a SQL on the database * This method will execute a SQL on the database
*
* @ctag DBInstance::execute($sql);
* @ctag DBInstance::execute($sql, []);
* *
* @param String $sql The SQL to be executed * @param String $sql The SQL to be executed
* @param Array $data Pass the info to be replaced on the query_prepare * @param Array $data Pass the info to be replaced on the query_prepare
@@ -36,7 +39,11 @@ class DBInstance {
$con->exec($sql); $con->exec($sql);
} }
} }
/*
*
* @ctag DBInstance::lastInsert();
*/
public static function lastInsert($instance = 'default') { public static function lastInsert($instance = 'default') {
$con = Connections::getConnection($instance); $con = Connections::getConnection($instance);
return $con->lastInsertId(); return $con->lastInsertId();
@@ -47,6 +54,9 @@ class DBInstance {
* *
* This method will execute a SQL and return a pointer to the resultset * This method will execute a SQL and return a pointer to the resultset
* *
* @ctag DBInstance::query($sql);
* @ctag DBInstance::query($sql, []);
*
* @param String $sql The SQL to be executed * @param String $sql The SQL to be executed
* @param Array $data Pass the info to be replaced on the query_prepare * @param Array $data Pass the info to be replaced on the query_prepare
* @param String $instance Select the connection to execute * @param String $instance Select the connection to execute
@@ -67,6 +77,9 @@ class DBInstance {
/** /**
* queryOne * queryOne
* *
* @ctag DBInstance::queryOne($sql);
* @ctag DBInstance::queryOne($sql, []);
*
* This method will execute a SQL and return the first featches register * This method will execute a SQL and return the first featches register
* *
* @param String $sql The SQL to be executed * @param String $sql The SQL to be executed
@@ -90,6 +103,10 @@ class DBInstance {
* *
* This method will execute get a register from a table * This method will execute get a register from a table
* *
* @ctag DBInstance::getRecord($table);
* @ctag DBInstance::getRecord($table, []);
* @ctag DBInstance::getRecord($table, [], []);
*
* @param String $table The table to be searched * @param String $table The table to be searched
* @param Array $data Pass the info to be replaced on the query_prepare * @param Array $data Pass the info to be replaced on the query_prepare
* @param Array $select Info to be put on the SELECT part of the query * @param Array $select Info to be put on the SELECT part of the query
@@ -135,6 +152,9 @@ class DBInstance {
* *
* This method will get a record from the database using SQL * This method will get a record from the database using SQL
* *
* @ctag DBInstance::getRecordSql($sql);
* @ctag DBInstance::getRecordSql($sql, []);
*
* @param String $sql The SQL to be executed * @param String $sql The SQL to be executed
* @param Array $data Pass the info to be replaced on the query_prepare * @param Array $data Pass the info to be replaced on the query_prepare
* @param String $instance Select the connection to execute * @param String $instance Select the connection to execute
@@ -157,6 +177,9 @@ class DBInstance {
* *
* This method will get records from the database * This method will get records from the database
* *
* @ctag DBInstance::getRecords($table);
* @ctag DBInstance::getRecords($table, []);
*
* @param String $table The table to be searched * @param String $table The table to be searched
* @param Array $data Pass the info to be replaced on the query_prepare * @param Array $data Pass the info to be replaced on the query_prepare
* @param Array $select Info to be put on the SELECT part of the query * @param Array $select Info to be put on the SELECT part of the query
@@ -201,6 +224,9 @@ class DBInstance {
* *
* This method will get records from the database * This method will get records from the database
* *
* @ctag DBInstance::getRecordsSql($sql);
* @ctag DBInstance::getRecordsSql($sql, []);
*
* @param String $sql The SQL to be executed * @param String $sql The SQL to be executed
* @param Array $data Pass the info to be replaced on the query_prepare * @param Array $data Pass the info to be replaced on the query_prepare
* @param String $instance Select the connection to execute * @param String $instance Select the connection to execute