PHP Class CrudKit\Data\SQLDataProvider

Inheritance: extends BaseSQLDataProvider
Show file Open project: skyronic/crudkit Class Usage Examples

Protected Properties

Property Type Description
$colDefs array Column definitions which are raw arrays and haven't been cast into the appropriate SQLColumn
$columns CrudKit\Data\SQL\SQLColumn[] An array of SQL Columns
$conn Doctrine\DBAL\Connection
$primary_col string
$summary_cols string[] A list of summary columns
$tableName string Name of the table

Public Methods

Method Description
__construct ( Doctrine\DBAL\Connection $connection, $table = null, $primaryColumn = null, array $summaryCols = [] )
addColumn ( $id, $expr, $label, $options = [] )
createItem ( array $values )
deleteItem ( $rowId )
deleteMultipleItems ( array $ids )
getData ( array $params = [] )
getEditForm ( $id = null )
getEditFormOrder ( )
getForeignValues ( $localKey, $value )
getRelationshipValues ( $id, $foreign )
getRow ( $id = null )
getRowCount ( array $params = [] )
getSchema ( )
getSummaryColumns ( )
hasMany ( $id, $label, $page, $options )
init ( )
manyToOne ( $id, $foreignKey, $extTable, $primary, $nameColumn, $label )
oneToMany ( $id, $dataProvider, $externalKey, $localKey, $name )
setConn ( Doctrine\DBAL\Connection $connection )
setPrimaryColumn ( $id, $expr )
setRow ( $id = null, array $values = [] )
setSummaryColumns ( array $summary_cols )
setTable ( $table )

Protected Methods

Method Description
addConditionsToBuilder ( $builder, $filters )
getPrimaryColumn ( ) : SQLColumn
getRequiredFields ( )
getValidatorForField ( $formKey )
internalAddColumn ( $category, $id, $options = [] )
isFieldInSchema ( $formKey )
postProcessColumns ( )
prepareObjectForClient ( $object )
processColumns ( ) Converts columns from raw objects to more powerful cool objects
queryColumns ( $queryType, $queryValues, $valueType, boolean $keyValue = false, $ignoreNull = false ) : array Super cool and useful function to query columns and get a reduced subset

Method Details

__construct() public method

public __construct ( Doctrine\DBAL\Connection $connection, $table = null, $primaryColumn = null, array $summaryCols = [] )
$connection Doctrine\DBAL\Connection
$summaryCols array

addColumn() public method

public addColumn ( $id, $expr, $label, $options = [] )

addConditionsToBuilder() protected method

protected addConditionsToBuilder ( $builder, $filters )
$builder QueryBuilder
$filters

createItem() public method

public createItem ( array $values )
$values array

deleteItem() public method

public deleteItem ( $rowId )

deleteMultipleItems() public method

public deleteMultipleItems ( array $ids )
$ids array

getData() public method

public getData ( array $params = [] )
$params array

getEditForm() public method

public getEditForm ( $id = null )

getEditFormOrder() public method

public getEditFormOrder ( )

getForeignValues() public method

public getForeignValues ( $localKey, $value )

getPrimaryColumn() protected method

protected getPrimaryColumn ( ) : SQLColumn
return CrudKit\Data\SQL\SQLColumn

getRelationshipValues() public method

public getRelationshipValues ( $id, $foreign )

getRequiredFields() protected method

protected getRequiredFields ( )

getRow() public method

public getRow ( $id = null )

getRowCount() public method

public getRowCount ( array $params = [] )
$params array

getSchema() public method

public getSchema ( )

getSummaryColumns() public method

public getSummaryColumns ( )

getValidatorForField() protected method

protected getValidatorForField ( $formKey )

hasMany() public method

public hasMany ( $id, $label, $page, $options )

init() public method

public init ( )

internalAddColumn() protected method

protected internalAddColumn ( $category, $id, $options = [] )

isFieldInSchema() protected method

protected isFieldInSchema ( $formKey )

manyToOne() public method

public manyToOne ( $id, $foreignKey, $extTable, $primary, $nameColumn, $label )

oneToMany() public method

public oneToMany ( $id, $dataProvider, $externalKey, $localKey, $name )

postProcessColumns() protected method

protected postProcessColumns ( )

prepareObjectForClient() protected method

protected prepareObjectForClient ( $object )

processColumns() protected method

Converts columns from raw objects to more powerful cool objects
protected processColumns ( )

queryColumns() protected method

Super cool and useful function to query columns and get a reduced subset
protected queryColumns ( $queryType, $queryValues, $valueType, boolean $keyValue = false, $ignoreNull = false ) : array
$queryType
$queryValues
$valueType
$keyValue boolean
return array

setConn() public method

public setConn ( Doctrine\DBAL\Connection $connection )
$connection Doctrine\DBAL\Connection

setPrimaryColumn() public method

public setPrimaryColumn ( $id, $expr )

setRow() public method

public setRow ( $id = null, array $values = [] )
$values array

setSummaryColumns() public method

public setSummaryColumns ( array $summary_cols )
$summary_cols array

setTable() public method

public setTable ( $table )
$table string

Property Details

$colDefs protected property

Column definitions which are raw arrays and haven't been cast into the appropriate SQLColumn
protected array $colDefs
return array

$columns protected property

An array of SQL Columns
protected SQLColumn[],CrudKit\Data\SQL $columns
return CrudKit\Data\SQL\SQLColumn[]

$conn protected property

protected Connection,Doctrine\DBAL $conn
return Doctrine\DBAL\Connection

$primary_col protected property

protected string $primary_col
return string

$summary_cols protected property

A list of summary columns
protected string[] $summary_cols
return string[]

$tableName protected property

Name of the table
protected string $tableName
return string