Overview

Namespaces

  • DSchoenbauer
    • Sql
      • Command
      • Exception
      • Where

Classes

  • Query
  • Overview
  • Namespace
  • Class

Class Query

a facade object that allows easier implementation of the SQL library

Namespace: DSchoenbauer\Sql
Author: David Schoenbauer dschoenbauer@gmail.com
Located at Sql/Query.php
Methods summary
public static static
# with( )

provides a means for functional access to the objects of this library

provides a means for functional access to the objects of this library

Returns

static
a new instance of this object

Since

v1.0.0
public DSchoenbauer\Sql\Command\Create
# create( string $table, array $data )

adds new data into a PDO connected resource

adds new data into a PDO connected resource

Parameters

$table
table with which you wish to append to
$data

a single level associative array containing keys that represent the fields and values that represent new values to be added into the table

Returns

DSchoenbauer\Sql\Command\Create
a create object that manages the addition of new records

Since

v1.0.0
public DSchoenbauer\Sql\Command\Select
# select( string $table, array $fields = [], DSchoenbauer\Sql\Where\WhereStatementInterface $where = null, integer $fetchStyle = DSchoenbauer\Sql\PDO::FETCH_ASSOC, boolean $fetchFlat = false, mixed $defaultValue = [] )

retrieves data from a PDO connected resource

retrieves data from a PDO connected resource

Parameters

$table
name of the table that houses the data
$fields

optional default value: empty array - defines which fields are returned if no fields defined a star will be used

$where

optional default value: null - object used to limit the returned results

$fetchStyle

optional default value: PDO::FETCH_ASSOC - sets how the PDO statement will return records

$fetchFlat

optional default value: false - true will return one record, false will return all records

$defaultValue

optional default value: empty array - value to be returned on query failure

Returns

DSchoenbauer\Sql\Command\Select
the select object responsible for retrieving records

Since

v1.0.0
public DSchoenbauer\Sql\Command\Update
# update( string $table, array $data, DSchoenbauer\Sql\Where\WhereStatementInterface $where = null )

changes values of existing data in a PDO connected resource

changes values of existing data in a PDO connected resource

Parameters

$table
table with which you wish to update
$data

a single level associative array containing keys that represent the fields and values that represent new values to be updated into the table

$where

an object that is designed to return a where statement to limit the data that is affected by the update

Returns

DSchoenbauer\Sql\Command\Update

the update object responsible to handling the update of persistent records.

Since

v1.0.0
public DSchoenbauer\Sql\Command\Delete
# delete( string $table, DSchoenbauer\Sql\Where\WhereStatementInterface $where = null )

removes records from a PDO connected resource

removes records from a PDO connected resource

Parameters

$table
table with which you wish to remove records from
$where

an object that is designed to return a where statement to limit the data that is affected by the delete

Returns

DSchoenbauer\Sql\Command\Delete

the delete object responsible for handling removal of persistent records

Since

v1.0.0
API documentation generated by ApiGen