PHP Class CrudKit\Data\ArrayDataProvider

Inheritance: extends BaseDataProvider
Show file Open project: skyronic/crudkit

Protected Properties

Property Type Description
$data array[]
$schema array[]
$summaryColumns string

Public Methods

Method Description
__construct ( array $schema, array $summaryCols, array $data = [] )
createItem ( array $values ) : integer
deleteItem ( mixed $rowId ) : boolean
deleteMultipleItems ( array $ids ) : boolean
getData ( array $params = [] )
getEditForm ( )
getEditFormOrder ( )
getRelationshipValues ( $id, $foreign_key ) : array
getRow ( $id = null )
getRowCount ( array $params = [] )
getSchema ( )
getSummaryColumns ( )
setRow ( $id = null, array $values = [] )

Protected Methods

Method Description
getRequiredFields ( ) : string[] Returns an array of require field names
getValidatorForField ( string $formKey ) : callable | null Returns a callable validator for this field if it exists, and null otherwise
isFieldInSchema ( string $formKey ) : boolean Returns true if a field exists as part of this source's schema

Private Methods

Method Description
addFormItemFromSchema ( CrudKit\Util\FormHelper $form, $columnId, array $columnOptions )

Method Details

__construct() public method

public __construct ( array $schema, array $summaryCols, array $data = [] )
$schema array
$summaryCols array
$data array

createItem() public method

public createItem ( array $values ) : integer
$values array
return integer

deleteItem() public method

public deleteItem ( mixed $rowId ) : boolean
$rowId mixed
return boolean

deleteMultipleItems() public method

public deleteMultipleItems ( array $ids ) : boolean
$ids array
return boolean

getData() public method

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

getEditForm() public method

public getEditForm ( )

getEditFormOrder() public method

public getEditFormOrder ( )

getRelationshipValues() public method

public getRelationshipValues ( $id, $foreign_key ) : array
$id
$foreign_key
return array

getRequiredFields() protected method

Returns an array of require field names
protected getRequiredFields ( ) : string[]
return string[]

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

Returns a callable validator for this field if it exists, and null otherwise
protected getValidatorForField ( string $formKey ) : callable | null
$formKey string
return callable | null

isFieldInSchema() protected method

Returns true if a field exists as part of this source's schema
protected isFieldInSchema ( string $formKey ) : boolean
$formKey string
return boolean

setRow() public method

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

Property Details

$data protected property

protected array[] $data
return array[]

$schema protected property

protected array[] $schema
return array[]

$summaryColumns protected property

protected string $summaryColumns
return string