mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Añadida la libreria datatables editor a third party
This commit is contained in:
82
ci4/app/ThirdParty/DatatablesEditor/Database/Driver/Db2Result.php
vendored
Normal file
82
ci4/app/ThirdParty/DatatablesEditor/Database/Driver/Db2Result.php
vendored
Normal file
@ -0,0 +1,82 @@
|
||||
<?php
|
||||
/**
|
||||
* SQL Server driver for DataTables PHP libraries
|
||||
* BETA! Feedback welcome
|
||||
*
|
||||
* @author SpryMedia
|
||||
* @copyright 2013 SpryMedia ( http://sprymedia.co.uk )
|
||||
* @license http://editor.datatables.net/license DataTables Editor
|
||||
* @link http://editor.datatables.net
|
||||
*/
|
||||
|
||||
namespace DataTables\Database\Driver;
|
||||
if (!defined('DATATABLES')) exit();
|
||||
|
||||
use PDO;
|
||||
use DataTables\Database\Result;
|
||||
|
||||
|
||||
/**
|
||||
* SQL Server driver for DataTables Database Result class
|
||||
* @internal
|
||||
*/
|
||||
class Db2Result extends Result {
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Constructor
|
||||
*/
|
||||
|
||||
function __construct( $dbh, $stmt )
|
||||
{
|
||||
$this->_dbh = $dbh;
|
||||
$this->_stmt = $stmt;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Private properties
|
||||
*/
|
||||
|
||||
private $_stmt;
|
||||
private $_dbh;
|
||||
private $_allRows = null;
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Public methods
|
||||
*/
|
||||
|
||||
public function count ()
|
||||
{
|
||||
$all = $this->_fetchAll();
|
||||
return count($all);
|
||||
}
|
||||
|
||||
|
||||
public function fetch ( $fetchType=\PDO::FETCH_ASSOC )
|
||||
{
|
||||
return db2_fetch_assoc( $this->_stmt );
|
||||
}
|
||||
|
||||
|
||||
public function fetchAll ( $fetchType=\PDO::FETCH_ASSOC )
|
||||
{
|
||||
$all = $this->_fetchAll();
|
||||
return $all;
|
||||
}
|
||||
|
||||
public function insertId ()
|
||||
{
|
||||
return db2_last_insert_id( $this->_dbh );
|
||||
}
|
||||
|
||||
private function _fetchAll () {
|
||||
$a = array();
|
||||
while ( $row = db2_fetch_assoc( $this->_stmt ) ) {
|
||||
$a[] = $row;
|
||||
}
|
||||
return $a;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user