Skip to content

Commit

Permalink
Update description class
Browse files Browse the repository at this point in the history
  • Loading branch information
priatmoko committed Dec 14, 2018
1 parent c28486c commit f7b49d4
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 4 deletions.
25 changes: 21 additions & 4 deletions src/Db2.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@

namespace Masterpis\Db2as400;

/**
* Db2As400 is a collection of attributes and methods to simplify connection to DB2 As400.
* The main purpose of this library is standarization of code in my small organization.
* It will provide basic operation of database connection
*
* This library is built on lumen, laravel
*
* Class Db2 provide instance methods to connect database Db2 AS400, driver selection, method compatible with driver
* Using this library will make you use same name method to operate connection and query.
*
*
* @link masterpis.com
* @since v1.0.0
* @author Priatmoko <[email protected]>
*
*/

class Db2{

/**
Expand Down Expand Up @@ -163,9 +180,9 @@ private function odbc()
* @param string $sql
* @return void
*/
public function execute($sql)
public function query($sql)
{
if (env('DB2_DRIVER')!="" && method_exists($this, "exec".ucfirst(strtolower(env('DB2_DRIVER'))))){
if (env('DB2_DRIVER')!="" && method_exists($this, "execute".ucfirst(strtolower(env('DB2_DRIVER'))))){
$method = "exec".ucfirst(strtolower(env('DB2_DRIVER')));
$this->$method($sql);
}
Expand All @@ -176,7 +193,7 @@ public function execute($sql)
* @param string $sql
* @return void
*/
private function execCom($sql)
private function executeCom($sql)
{
try {
$row = $this->con->execute($sql);
Expand All @@ -196,7 +213,7 @@ private function execCom($sql)
* @param string $sql
* @return void
*/
private function execOdbc($sql)
private function executeOdbc($sql)
{
try {
$row = odbc_exec($this->con, $sql);
Expand Down
51 changes: 51 additions & 0 deletions src/Model.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

namespace Masterpis\Db2As400;

use Masterpis\Db2As400\Db2;

/**
* Db2As400 is a collection of attributes and methods to simplify connection to DB2 As400.
* The main purpose of this library is standarization of code in my small organization.
* It will provide basic operation of database connection
*
* This library is built on lumen, laravel
*
* Class Model provide simple query methods
* Using this library will make you use same name method to operate connection and query.
*
*
* @link masterpis.com
* @since v1.0.0
* @author Priatmoko <[email protected]>
*
*/

class Model extends Db2{

/**
* Filtering query result using LIKE clause
* @var array
*/
protected $like;

/**
* Sorting query result
* @var array
*/
protected $order;
protected $limit;
protected $server;
protected $fields;
protected $user;

public function __construct()
{

}

public function get(){

}

}

0 comments on commit f7b49d4

Please sign in to comment.