CMC for PHP
  • Namespace
  • Class
  • Tree

Namespaces

  • cmc
    • core
      • ui
    • db
      • mysqli
    • error
    • ui
      • widgets
  • PHP

Classes

  • database_mysqli
  • database_mysqli_factory
  • dataenv_mysqli
  • dataquery_mysqli
  • datasource_mysqli
  • datatable_mysqli

Exceptions

  • DatabaseException_mysqli

CMC for PHP is a web framework for PHP.
Copyright (c) 2014 by Calmarsoft company http://calmarsoft.com (FRANCE). All rights reserved.
Project information available here.

Class datatable_mysqli

mysqli datasource implementation

cmc\db\datatable implements cmc\db\datasource, cmc\db\IUpdatable, cmc\db\IFilter, cmc\db\IPrimaryKey, cmc\db\IMetaInfo
Extended by cmc\db\mysqli\datatable_mysqli
Namespace: cmc\db\mysqli
Copyright: Copyright (c) Calmarsoft company (FRANCE) (http://calmarsoft.com)
License: GNU General Public License version 3
Version: 0.9
Link: CMC Project
Located at db/mysqli/datatable_mysqli.php

Methods summary

public static cmc\db\mysqli\datatable_mysqli
# create( cmc\db\mysqli\database_mysqli $db, string $tablename, array $sort )

creates a new table instance

creates a new table instance

Parameters

$db
cmc\db\mysqli\database_mysqli
$db
$tablename
string
$tablename
$sort
array
$sort the simple array of sort fields

Returns

cmc\db\mysqli\datatable_mysqli
public
# deleteData( tarray $key )

deletes a record designated by the associative array the key paramter must be complete

deletes a record designated by the associative array the key paramter must be complete

Parameters

$key
tarray
$key

Throws

cmc\db\DatabaseException
public
# insertData( array $data )

inserts new data using the provided associative array

inserts new data using the provided associative array

Parameters

$data
array
$data

Throws

cmc\db\DatabaseException
public
# updateData( array $data )

updates a row with the provided data the modified data is an associative array

updates a row with the provided data the modified data is an associative array

the values for each primary key elements must be provided the primary key value cannot be altered using this function

Parameters

$data
array
$data

Throws

cmc\db\DatabaseException
public array
# getUniqueKey( boolean $bAll = true )

retrives the primary or unique key composition returns an associative array with 'name', 'flags', etc. fields.

retrives the primary or unique key composition returns an associative array with 'name', 'flags', etc. fields.

Parameters

$bAll
boolean
$bAll if false it ignores auto increment fields (for insert)

Returns

array

Throws

cmc\db\DatabaseException
public
# close( )

closes the table

closes the table

public null|array
# current( )

returns the current record data

returns the current record data

Returns

null|array
public integer
# key( )

returns a value representing the current position. Warning: this is not a consistent value, if underlying data changes or if the filtering/ordering options change

returns a value representing the current position. Warning: this is not a consistent value, if underlying data changes or if the filtering/ordering options change

Returns

integer
public array
# next( )

reads next records and returns the data in an associative array

reads next records and returns the data in an associative array

Returns

array
public
# rewind( )

reset position before first record

reset position before first record

public
# getRowCopy( )
public boolean
# valid( )

returns if there is a valid current record

returns if there is a valid current record

Returns

boolean
public
# setFilter( array $data )

defines a filter 'equal' criteria for the table

defines a filter 'equal' criteria for the table

Parameters

$data
array
$data
public
# cancelFilter( )

cancel a previously defined filter

cancel a previously defined filter

public
# getPrimaryKey( )

gets the value of the primary key Returns an array or a scalar

gets the value of the primary key Returns an array or a scalar

Returns

mixed
public
# seekPrimaryKey( mixed $key )

seeks using a primary key value

seeks using a primary key value

Parameters

$key
mixed
$key primary key value (scalar or array)

Returns

array|null
public
# getItems( )
public
# getKeyItems( )

returns a traversable object of items of the unique key

returns a traversable object of items of the unique key

Returns

array

Magic methods summary

Constants summary

Constants inherited from cmc\db\datatable

className

Properties summary

Properties inherited from cmc\db\datatable

$_currentrow, $_position

CMC for PHP API documentation generated by ApiGen 2.8.0