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:
75
ci4/app/ThirdParty/DatatablesEditor/Database/Driver/PostgresResult.php
vendored
Normal file
75
ci4/app/ThirdParty/DatatablesEditor/Database/Driver/PostgresResult.php
vendored
Normal file
@ -0,0 +1,75 @@
|
||||
<?php
|
||||
/**
|
||||
* DataTables PHP libraries.
|
||||
*
|
||||
* PHP libraries for DataTables and DataTables Editor, utilising PHP 5.3+.
|
||||
*
|
||||
* @author SpryMedia
|
||||
* @copyright 2012 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;
|
||||
|
||||
|
||||
/**
|
||||
* Postgres driver for DataTables Database Result class
|
||||
* @internal
|
||||
*/
|
||||
class PostgresResult extends Result {
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Constructor
|
||||
*/
|
||||
|
||||
function __construct( $dbh, $stmt )
|
||||
{
|
||||
$this->_dbh = $dbh;
|
||||
$this->_stmt = $stmt;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Private properties
|
||||
*/
|
||||
|
||||
private $_stmt;
|
||||
private $_dbh;
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Public methods
|
||||
*/
|
||||
|
||||
public function count ()
|
||||
{
|
||||
return count($this->fetchAll());
|
||||
}
|
||||
|
||||
|
||||
public function fetch ( $fetchType=\PDO::FETCH_ASSOC )
|
||||
{
|
||||
return $this->_stmt->fetch( $fetchType );
|
||||
}
|
||||
|
||||
|
||||
public function fetchAll ( $fetchType=\PDO::FETCH_ASSOC )
|
||||
{
|
||||
return $this->_stmt->fetchAll( $fetchType );
|
||||
}
|
||||
|
||||
|
||||
public function insertId ()
|
||||
{
|
||||
// Only useful after an insert of course...
|
||||
$rows = $this->_stmt->fetchAll();
|
||||
return $rows[0]['dt_pkey'];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user