PHP Class Jarves\Admin\ObjectCrud

Inheritance: implements Jarves\Admin\ObjectCrudInterface
Show file Open project: jarves/jarves Class Usage Examples

Protected Properties

Property Type Description
$_fields Jarves\Configuration\Field[] Flatten list of fields.
$acl Jarves\ACL
$add boolean Defines whether the add button should be displayed
$addEntrypoint string Default is /. Relative or absolute paths are allowed. Empty means current entrypoint.
$addIcon Defines the icon for the add button. Relative to media/ or #className for vector images
$addMultiple
$addMultipleFieldContainerWidth
$addMultipleFields
$addMultipleFixedFields
$allowCustomFieldSelection boolean (?fields=...)
$asNested boolean Is automatically set when object property is defined.
$columns array This is used by the listing crud window (and GET of the REST api) Only one level, no children, no tabs. Use the crud editor, to get the list of possible types.
$conditionOperator Jarves\ConditionOperator
$customOrderBy string Order field
$defaultLimit Defines how many items should be displayed per page.
$domain integer The current domain id to filter if domainDepended is enabled.
$domainDepended boolean Note: Your table need a field 'domain_id' int. The windowList class filter by this.
$edit boolean Defines whether the edit button should be displayed
$editEntrypoint string Default is /. Relative or absolute paths are allowed. Empty means current entrypoint.
$editIcon Defines the icon for the edit button. Relative to media/ or #className for vector images
$eventDispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface
$extraSelection string | array Only field names allowed that are available by the underlying object. Comma separated or as array.
$fields array Can contains several fields nested, via 'children', also type 'tab' are allowed. Every jarves.field is allowed.
$filter array Contains the fields for the search.
$filterFields array
$itemLayout string
$itemsPerPage integer
$jarves Jarves\Jarves
$language string The current language to filter if multiLanguage is enabled.
$multiLanguage boolean Note: Your table need a field 'lang' varchar(2). The windowList class filter by this. If the object is nested=true and have a root object
$nestedAddWithPositionSelection
$nestedMoveable
$nestedRootAdd
$nestedRootAddEntrypoint
$nestedRootAddIcon
$nestedRootAddLabel
$nestedRootEdit
$nestedRootEditEntrypoint
$nestedRootRemove
$nestedRootRemoveEntrypoint
$newLabel
$object Defines the object which should be used.
$objectBased boolean Whether this CRUD view is based on a object with an id.
$objectDefinition Jarves\Configuration\Object Copy of the object definition, by is being set in the initialisation. Only set when object property is defined.
$objects Jarves\Objects
$order array array( array('field' => 'group_id', 'direction' => 'asc'), array('field' => 'title', 'direction' => 'asc') ); or array( 'group_id' => 'asc', 'title' => 'desc' )
$orderBy string Order field
$orderByDirection string Order direction
$permissionCheck boolean Deactivate this means this object does not listen to any ACL.
$primary array Example: $primary = array('id'); Example: $primary = array('id', 'name'); Use this only if you know, what you're doing, normally this comes from the object settings.
$primaryKey array If the class created a item through addItem(), it contains the primary key of the newly created item. array( 'id' => 1234 ) array( 'id' => 1234, 'subId' => 5678 )
$remove boolean Defines whether the remove/delete button should be displayed Also on each row the Delete-Button and the checkboxes.
$removeEntrypoint string
$removeIcon Defines the icon for the remove/delete button. Relative to media/ or #className for vector images
$removeIconItem Defines the icon for the remove/delete button. Relative to media/ or #className for vector images
$requestStack Symfony\Component\HttpFoundation\RequestStack
$startCombine
$table Use this only if you know, what you're doing, normally this comes from the object definition from the object property.
$translator Jarves\Translation\Translator
$usePatch boolean 'PUT' requires that you send all field, and 'PATCH' only the fields that need to be updated.
$utils Jarves\Utils
$withNewsFeed boolean
$workspace boolean Needs a column workspace_id in the table or active workspace at object.

Public Methods

Method Description
__construct ( Translator $translator, Objects $objects, Jarves $jarves, Symfony\Component\HttpFoundation\RequestStack $requestStack, ConditionOperator $conditionOperator, ACL $acl, Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher, Utils $utils ) ObjectCrud constructor.
add ( Request | array $requestOrData, array | null $pk = null, string | null $position = null, string | null $targetObjectKey = null ) : mixed Adds a new item.
addMultiple ( Request $request ) : array | mixed Adds multiple entries.
buildFilter ( array $filter ) : array | null
collectData ( Request | array $requestData ) : array
getAdd ( ) : boolean
getAddEntrypoint ( ) : string
getAddIcon ( ) : string
getAddMultiple ( )
getAddMultipleFieldContainerWidth ( )
getAddMultipleFields ( )
getAddMultipleFixedFields ( )
getAllowCustomFieldSelection ( ) : boolean
getAsNested ( ) : boolean
getBranchChildrenCount ( mixed $pk = null, mixed $scope = null, array $filter = null ) : array Returns items count per branch.
getBranchItems ( mixed $pk = null, array $filter = null, mixed $fields = null, mixed $scope = null, integer $depth = 1, integer $limit = null, integer $offset = null, boolean $withAcl = false ) : mixed Returns items per branch.
getColumns ( ) : array
getCondition ( ) : Condition Here you can define additional conditions for all operations (edit/listing).
getCount ( Condition | array $filter, string $query = '' ) : integer
getCustomEditCondition ( ) : Condition Here you can define additional conditions for edit operations.
getCustomListingCondition ( ) : Condition Here you can define additional conditions for listing operations.
getCustomOrderBy ( ) : string
getDefaultFieldList ( ) : array Get a list of field key for $this->_fields
getDefaultLimit ( ) : integer
getDomain ( ) : integer The current domain id to filter if domainDepended is enabled.
getDomainDepended ( ) : boolean
getEdit ( ) : boolean
getEditEntrypoint ( ) : string
getEditIcon ( ) : string
getExtraSelection ( ) : array
getFields ( ) : Field[]
getFilter ( ) : array
getFilterFields ( )
getInfo ( )
getInitializedFields ( ) : Field[]
getItem ( array $pk, array $fields = null, boolean $withAcl = false ) : array $pk is an array with the primary key values.
getItemLayout ( )
getItems ( array $filter = null, integer $limit = null, integer $offset = null, string $query = '', string $fields = null, array $orderBy = [], boolean $withAcl = false, array $primaryKeys = [] ) : array array( 'items' => $items, 'count' => $maxItems, 'pages' => $maxPages );
getItemsPerPage ( ) : integer
getLanguage ( ) : string The current language to filter if multiLanguage is enabled.
getMultiLanguage ( ) : boolean
getNestedAddWithPositionSelection ( )
getNestedMoveable ( )
getNestedRootAdd ( )
getNestedRootAddEntrypoint ( )
getNestedRootAddIcon ( )
getNestedRootAddLabel ( )
getNestedRootEdit ( )
getNestedRootEditEntrypoint ( )
getNestedRootRemove ( )
getNestedRootRemoveEntrypoint ( )
getNewLabel ( )
getObject ( ) : string
getObjectBased ( ) : boolean
getObjectDefinition ( ) : Object
getOrder ( ) : array
getOrderBy ( ) : string
getOrderByDirection ( ) : string
getParent ( $pk, $fields = null )
getParents ( $pk )
getPermissionCheck ( ) : boolean
getPosition ( $pk, $order )
getPrimary ( ) : array
getPrimaryKey ( ) : array The primary key of the current object.
getRemove ( ) : boolean
getRemoveEntrypoint ( )
getRemoveIcon ( ) : string
getRemoveIconItem ( ) : string
getRoot ( $scope = null )
getRoots ( $condition = null, $lang = null, $domain )
getStartCombine ( ) : boolean
getTable ( ) : string
getTreeFields ( string $fields = null ) : array
getUsePatch ( ) : boolean
getWithNewsFeed ( ) : boolean
getWorkspace ( ) : boolean
initialize ( boolean $withoutObjectCheck = false )
isObjectBased ( ) : boolean
mapData ( array $data, array $filterFields = null, mixed $defaultData = null ) : array Maps all $data to its field values (Admin\Type*::mapValues) Iterates only through all defined fields in $fields.
moveItem ( $pk, $targetPk, $position = 'first', $targetObjectKey = '' )
patch ( array $pk, Request | array $requestOrData ) : boolean Patches a object entry. This means, only defined fields will be saved. Fields which are not defined will not be overwritten.
prepareFieldAcl ( &$item )
prepareFieldDefinition ( array &$fields ) prepares $fields. Replace array items which are only a key (with no array definition) with the array definition of the proper field from the object fields.
prepareFieldItem ( Field[] | Field $fields ) Prepare fields. Loading tableItems by select and file fields.
prepareRow ( array &$item ) : array Each item goes through this function in getItems(). Defines whether a item is editable or deleteable.
remove ( $pk ) : boolean
setAdd ( boolean $add )
setAddEntrypoint ( string $addEntrypoint )
setAddIcon ( string $addIcon )
setAddMultiple ( $addMultiple )
setAddMultipleFieldContainerWidth ( $addMultipleFieldContainerWidth )
setAddMultipleFields ( $addMultipleFields )
setAddMultipleFixedFields ( $addMultipleFixedFields )
setAllowCustomFieldSelection ( boolean $allowExtraFieldSelection )
setAsNested ( boolean $asNested )
setColumns ( array $columns )
setCustomOrderBy ( string $customOrderBy )
setDefaultLimit ( integer $defaultLimit )
setDomain ( integer $domain )
setDomainDepended ( boolean $domainDepended )
setEdit ( boolean $edit )
setEditEntrypoint ( string $editEntrypoint )
setEditIcon ( $editIcon )
setExtraSelection ( array | string $selection )
setFields ( array $fields )
setFilter ( array $filter )
setFilterFields ( $filterFields )
setItemLayout ( $itemLayout )
setItemsPerPage ( integer $itemsPerPage )
setLanguage ( string $language )
setMultiLanguage ( boolean $multiLanguage )
setNestedAddWithPositionSelection ( $nestedAddWithPositionSelection )
setNestedMoveable ( $nestedMoveable )
setNestedRootAdd ( $nestedRootAdd )
setNestedRootAddEntrypoint ( $nestedRootAddEntrypoint )
setNestedRootAddIcon ( $nestedRootAddIcon )
setNestedRootAddLabel ( $nestedRootAddLabel )
setNestedRootEdit ( $nestedRootEdit )
setNestedRootEditEntrypoint ( $nestedRootEditEntrypoint )
setNestedRootRemove ( $nestedRootRemove )
setNestedRootRemoveEntrypoint ( $nestedRootRemoveEntrypoint )
setNewLabel ( $newLabel )
setObject ( string $object )
setObjectBased ( boolean $objectBased )
setObjectDefinition ( array $objectDefinition )
setOrder ( array $order )
setOrderBy ( string $orderBy )
setOrderByDirection ( string $orderByDirection )
setPermissionCheck ( boolean $permissionCheck )
setPrimary ( array $primary )
setRemove ( boolean $remove )
setRemoveEntrypoint ( $removeEntrypoint )
setRemoveIcon ( string $removeIcon )
setRemoveIconItem ( string $removeIconItem )
setStartCombine ( boolean $startCombine )
setTable ( string $table )
setUsePatch ( boolean $usePatch )
setWithNewsFeed ( boolean $withNewsFeed )
setWorkspace ( boolean $workspace )
toIdIndex ( Field[] $fieldArray )
translate ( &$field )
translateFields ( array | Field $fields ) Translate the label/title item of $fields.
update ( array $pk, Request | array $requestOrData ) : boolean Updates a object entry. This means, all fields which are not defined will be saved as NULL.

Protected Methods

Method Description
applyDefaultSelection ( array $fields ) : array Adds labelField, extraSelection and filter by blacklistSelection
convertToFieldObjects ( array &$fields ) Converst array field definition to real Field objects.
ensureLanguageField ( ) Makes sure $this->_fields has a language field when multiLanguage=true
getBranchItemsSelection ( string | array $fields = null ) : array Returns the field list for branchItems selection.
getItemSelection ( string | array $fields = null ) : array Returns the field list for single item selection.
getItemsSelection ( string | array $fields = null ) : array Returns the field list for items selection.
getNestedSelection ( $fields )
getQueryCondition ( $query, $fields )

Method Details

__construct() public method

ObjectCrud constructor.
public __construct ( Translator $translator, Objects $objects, Jarves $jarves, Symfony\Component\HttpFoundation\RequestStack $requestStack, ConditionOperator $conditionOperator, ACL $acl, Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher, Utils $utils )
$translator Jarves\Translation\Translator
$objects Jarves\Objects
$jarves Jarves\Jarves
$requestStack Symfony\Component\HttpFoundation\RequestStack
$conditionOperator Jarves\ConditionOperator
$acl Jarves\ACL
$eventDispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface
$utils Jarves\Utils

add() public method

Data is passed as POST.
public add ( Request | array $requestOrData, array | null $pk = null, string | null $position = null, string | null $targetObjectKey = null ) : mixed
$requestOrData Symfony\Component\HttpFoundation\Request | array
$pk array | null
$position string | null If nested set. `first` (child), `last` (child), `prev` (sibling), `next` (sibling)
$targetObjectKey string | null
return mixed false if some went wrong or a array with the new primary keys.

addMultiple() public method

We need as POST following data: { _items: [ {field1: 'foo', field2: 'bar'}, {field1: 'foo2', field2: 'bar2'}, .... ], same value across all items, all without underscore fixedField1: 'asd', field3: 'fgh', _position: 'first', //take a look at $this->objects->add() at parameter $pPosition _pk: { id: 123132 }, can differ between the actual object and the target (if we have a different object as root, then only position first and 'last` are available.) _targetObjectKey: 'jarves/node' }
public addMultiple ( Request $request ) : array | mixed
$request Symfony\Component\HttpFoundation\Request
return array | mixed

applyDefaultSelection() protected method

Adds labelField, extraSelection and filter by blacklistSelection
protected applyDefaultSelection ( array $fields ) : array
$fields array
return array

buildFilter() public static method

public static buildFilter ( array $filter ) : array | null
$filter array
return array | null

collectData() public method

public collectData ( Request | array $requestData ) : array
$requestData Symfony\Component\HttpFoundation\Request | array *@return array
return array

convertToFieldObjects() protected method

Converst array field definition to real Field objects.
protected convertToFieldObjects ( array &$fields )
$fields array

ensureLanguageField() protected method

Makes sure $this->_fields has a language field when multiLanguage=true
protected ensureLanguageField ( )

getAdd() public method

public getAdd ( ) : boolean
return boolean

getAddEntrypoint() public method

public getAddEntrypoint ( ) : string
return string

getAddIcon() public method

public getAddIcon ( ) : string
return string

getAddMultiple() public method

public getAddMultiple ( )

getAddMultipleFieldContainerWidth() public method

getAddMultipleFields() public method

getAddMultipleFixedFields() public method

getAllowCustomFieldSelection() public method

getAsNested() public method

public getAsNested ( ) : boolean
return boolean

getBranchChildrenCount() public method

Returns items count per branch.
public getBranchChildrenCount ( mixed $pk = null, mixed $scope = null, array $filter = null ) : array
$pk mixed
$scope mixed
$filter array
return array

getBranchItems() public method

Returns items per branch.
public getBranchItems ( mixed $pk = null, array $filter = null, mixed $fields = null, mixed $scope = null, integer $depth = 1, integer $limit = null, integer $offset = null, boolean $withAcl = false ) : mixed
$pk mixed
$filter array
$fields mixed
$scope mixed
$depth integer
$limit integer
$offset integer
$withAcl boolean
return mixed

getBranchItemsSelection() protected method

Returns the field list for branchItems selection.
protected getBranchItemsSelection ( string | array $fields = null ) : array
$fields string | array
return array

getColumns() public method

public getColumns ( ) : array
return array

getCondition() public method

Here you can define additional conditions for all operations (edit/listing).
public getCondition ( ) : Condition
return Jarves\Configuration\Condition definition

getCount() public method

public getCount ( Condition | array $filter, string $query = '' ) : integer
$filter Jarves\Configuration\Condition | array
$query string
return integer

getCustomEditCondition() public method

Here you can define additional conditions for edit operations.
public getCustomEditCondition ( ) : Condition
return Jarves\Configuration\Condition definition

getCustomListingCondition() public method

Here you can define additional conditions for listing operations.
public getCustomListingCondition ( ) : Condition
return Jarves\Configuration\Condition definition

getCustomOrderBy() public method

public getCustomOrderBy ( ) : string
return string

getDefaultFieldList() public method

Get a list of field key for $this->_fields
public getDefaultFieldList ( ) : array
return array

getDefaultLimit() public method

public getDefaultLimit ( ) : integer
return integer

getDomain() public method

The current domain id to filter if domainDepended is enabled.
public getDomain ( ) : integer
return integer

getDomainDepended() public method

public getDomainDepended ( ) : boolean
return boolean

getEdit() public method

public getEdit ( ) : boolean
return boolean

getEditEntrypoint() public method

public getEditEntrypoint ( ) : string
return string

getEditIcon() public method

public getEditIcon ( ) : string
return string

getExtraSelection() public method

public getExtraSelection ( ) : array
return array

getFields() public method

public getFields ( ) : Field[]
return Jarves\Configuration\Field[]

getFilter() public method

public getFilter ( ) : array
return array

getFilterFields() public method

public getFilterFields ( )

getInfo() public method

public getInfo ( )

getInitializedFields() public method

public getInitializedFields ( ) : Field[]
return Jarves\Configuration\Field[]

getItem() public method

If one primary key: array( 'id' => 1234 ) If multiple primary keys: array( 'id' => 1234 'secondId' => 5678 )
public getItem ( array $pk, array $fields = null, boolean $withAcl = false ) : array
$pk array
$fields array
$withAcl boolean
return array

getItemLayout() public method

public getItemLayout ( )

getItemSelection() protected method

Returns the field list for single item selection.
protected getItemSelection ( string | array $fields = null ) : array
$fields string | array
return array

getItems() public method

array( 'items' => $items, 'count' => $maxItems, 'pages' => $maxPages );
public getItems ( array $filter = null, integer $limit = null, integer $offset = null, string $query = '', string $fields = null, array $orderBy = [], boolean $withAcl = false, array $primaryKeys = [] ) : array
$filter array
$limit integer
$offset integer
$query string
$fields string
$orderBy array
$withAcl boolean
$primaryKeys array
return array

getItemsPerPage() public method

public getItemsPerPage ( ) : integer
return integer

getItemsSelection() protected method

Returns the field list for items selection.
protected getItemsSelection ( string | array $fields = null ) : array
$fields string | array
return array

getLanguage() public method

The current language to filter if multiLanguage is enabled.
public getLanguage ( ) : string
return string

getMultiLanguage() public method

public getMultiLanguage ( ) : boolean
return boolean

getNestedAddWithPositionSelection() public method

getNestedMoveable() public method

public getNestedMoveable ( )

getNestedRootAdd() public method

public getNestedRootAdd ( )

getNestedRootAddEntrypoint() public method

getNestedRootAddIcon() public method

getNestedRootAddLabel() public method

getNestedRootEdit() public method

public getNestedRootEdit ( )

getNestedRootEditEntrypoint() public method

getNestedRootRemove() public method

public getNestedRootRemove ( )

getNestedRootRemoveEntrypoint() public method

getNestedSelection() protected method

protected getNestedSelection ( $fields )

getNewLabel() public method

public getNewLabel ( )

getObject() public method

public getObject ( ) : string
return string

getObjectBased() public method

public getObjectBased ( ) : boolean
return boolean

getObjectDefinition() public method

public getObjectDefinition ( ) : Object
return Jarves\Configuration\Object

getOrder() public method

public getOrder ( ) : array
return array

getOrderBy() public method

public getOrderBy ( ) : string
return string

getOrderByDirection() public method

public getOrderByDirection ( ) : string
return string

getParent() public method

public getParent ( $pk, $fields = null )

getParents() public method

public getParents ( $pk )

getPermissionCheck() public method

public getPermissionCheck ( ) : boolean
return boolean

getPosition() public method

public getPosition ( $pk, $order )

getPrimary() public method

public getPrimary ( ) : array
return array

getPrimaryKey() public method

If the class created a item through addItem(), it contains the primary key of the newly created item. array( 'id' => 1234 ) array( 'id' => 1234, 'subId' => 5678 )
public getPrimaryKey ( ) : array
return array

getQueryCondition() protected method

protected getQueryCondition ( $query, $fields )

getRemove() public method

public getRemove ( ) : boolean
return boolean

getRemoveEntrypoint() public method

public getRemoveEntrypoint ( )

getRemoveIcon() public method

public getRemoveIcon ( ) : string
return string

getRemoveIconItem() public method

public getRemoveIconItem ( ) : string
return string

getRoot() public method

public getRoot ( $scope = null )

getRoots() public method

public getRoots ( $condition = null, $lang = null, $domain )

getStartCombine() public method

public getStartCombine ( ) : boolean
return boolean

getTable() public method

public getTable ( ) : string
return string

getTreeFields() public method

public getTreeFields ( string $fields = null ) : array
$fields string
return array

getUsePatch() public method

public getUsePatch ( ) : boolean
return boolean

getWithNewsFeed() public method

public getWithNewsFeed ( ) : boolean
return boolean

getWorkspace() public method

public getWorkspace ( ) : boolean
return boolean

initialize() public method

public initialize ( boolean $withoutObjectCheck = false )
$withoutObjectCheck boolean

isObjectBased() public method

public isObjectBased ( ) : boolean
return boolean

mapData() public method

Maps all $data to its field values (Admin\Type*::mapValues) Iterates only through all defined fields in $fields.
public mapData ( array $data, array $filterFields = null, mixed $defaultData = null ) : array
$data array
$filterFields array Field name list to map, empty for all
$defaultData mixed Default data. Is used if a field is not defined through _POST or _GET
return array

moveItem() public method

public moveItem ( $pk, $targetPk, $position = 'first', $targetObjectKey = '' )

patch() public method

Patches a object entry. This means, only defined fields will be saved. Fields which are not defined will not be overwritten.
public patch ( array $pk, Request | array $requestOrData ) : boolean
$pk array
$requestOrData Symfony\Component\HttpFoundation\Request | array
return boolean

prepareFieldAcl() public method

public prepareFieldAcl ( &$item )

prepareFieldDefinition() public method

prepares $fields. Replace array items which are only a key (with no array definition) with the array definition of the proper field from the object fields.
public prepareFieldDefinition ( array &$fields )
$fields array

prepareFieldItem() public method

Adds lang field when necessary.
public prepareFieldItem ( Field[] | Field $fields )
$fields Jarves\Configuration\Field[] | Jarves\Configuration\Field

prepareRow() public method

You can attach here extra action icons, too. Result should be: $item['_editable'] = true|false $item['_deleteable'] = true|false $item['_actions'] = array( array('/* action * /') //todo ) )
public prepareRow ( array &$item ) : array
$item array
return array

remove() public method

public remove ( $pk ) : boolean
$pk
return boolean

setAdd() public method

public setAdd ( boolean $add )
$add boolean

setAddEntrypoint() public method

public setAddEntrypoint ( string $addEntrypoint )
$addEntrypoint string

setAddIcon() public method

public setAddIcon ( string $addIcon )
$addIcon string

setAddMultiple() public method

public setAddMultiple ( $addMultiple )

setAddMultipleFieldContainerWidth() public method

public setAddMultipleFieldContainerWidth ( $addMultipleFieldContainerWidth )

setAddMultipleFields() public method

public setAddMultipleFields ( $addMultipleFields )

setAddMultipleFixedFields() public method

public setAddMultipleFixedFields ( $addMultipleFixedFields )

setAllowCustomFieldSelection() public method

public setAllowCustomFieldSelection ( boolean $allowExtraFieldSelection )
$allowExtraFieldSelection boolean

setAsNested() public method

public setAsNested ( boolean $asNested )
$asNested boolean

setColumns() public method

public setColumns ( array $columns )
$columns array

setCustomOrderBy() public method

public setCustomOrderBy ( string $customOrderBy )
$customOrderBy string

setDefaultLimit() public method

public setDefaultLimit ( integer $defaultLimit )
$defaultLimit integer

setDomain() public method

public setDomain ( integer $domain )
$domain integer

setDomainDepended() public method

public setDomainDepended ( boolean $domainDepended )
$domainDepended boolean

setEdit() public method

public setEdit ( boolean $edit )
$edit boolean

setEditEntrypoint() public method

public setEditEntrypoint ( string $editEntrypoint )
$editEntrypoint string

setEditIcon() public method

public setEditIcon ( $editIcon )

setExtraSelection() public method

public setExtraSelection ( array | string $selection )
$selection array | string

setFields() public method

public setFields ( array $fields )
$fields array

setFilter() public method

public setFilter ( array $filter )
$filter array

setFilterFields() public method

public setFilterFields ( $filterFields )

setItemLayout() public method

public setItemLayout ( $itemLayout )

setItemsPerPage() public method

public setItemsPerPage ( integer $itemsPerPage )
$itemsPerPage integer

setLanguage() public method

public setLanguage ( string $language )
$language string

setMultiLanguage() public method

public setMultiLanguage ( boolean $multiLanguage )
$multiLanguage boolean

setNestedAddWithPositionSelection() public method

public setNestedAddWithPositionSelection ( $nestedAddWithPositionSelection )

setNestedMoveable() public method

public setNestedMoveable ( $nestedMoveable )

setNestedRootAdd() public method

public setNestedRootAdd ( $nestedRootAdd )

setNestedRootAddEntrypoint() public method

public setNestedRootAddEntrypoint ( $nestedRootAddEntrypoint )

setNestedRootAddIcon() public method

public setNestedRootAddIcon ( $nestedRootAddIcon )

setNestedRootAddLabel() public method

public setNestedRootAddLabel ( $nestedRootAddLabel )

setNestedRootEdit() public method

public setNestedRootEdit ( $nestedRootEdit )

setNestedRootEditEntrypoint() public method

public setNestedRootEditEntrypoint ( $nestedRootEditEntrypoint )

setNestedRootRemove() public method

public setNestedRootRemove ( $nestedRootRemove )

setNestedRootRemoveEntrypoint() public method

public setNestedRootRemoveEntrypoint ( $nestedRootRemoveEntrypoint )

setNewLabel() public method

public setNewLabel ( $newLabel )

setObject() public method

public setObject ( string $object )
$object string

setObjectBased() public method

public setObjectBased ( boolean $objectBased )
$objectBased boolean

setObjectDefinition() public method

public setObjectDefinition ( array $objectDefinition )
$objectDefinition array

setOrder() public method

public setOrder ( array $order )
$order array

setOrderBy() public method

public setOrderBy ( string $orderBy )
$orderBy string

setOrderByDirection() public method

public setOrderByDirection ( string $orderByDirection )
$orderByDirection string

setPermissionCheck() public method

public setPermissionCheck ( boolean $permissionCheck )
$permissionCheck boolean

setPrimary() public method

public setPrimary ( array $primary )
$primary array

setRemove() public method

public setRemove ( boolean $remove )
$remove boolean

setRemoveEntrypoint() public method

public setRemoveEntrypoint ( $removeEntrypoint )

setRemoveIcon() public method

public setRemoveIcon ( string $removeIcon )
$removeIcon string

setRemoveIconItem() public method

public setRemoveIconItem ( string $removeIconItem )
$removeIconItem string

setStartCombine() public method

public setStartCombine ( boolean $startCombine )
$startCombine boolean

setTable() public method

public setTable ( string $table )
$table string

setUsePatch() public method

public setUsePatch ( boolean $usePatch )
$usePatch boolean

setWithNewsFeed() public method

public setWithNewsFeed ( boolean $withNewsFeed )
$withNewsFeed boolean

setWorkspace() public method

public setWorkspace ( boolean $workspace )
$workspace boolean

toIdIndex() public method

public toIdIndex ( Field[] $fieldArray )
$fieldArray Jarves\Configuration\Field[]

translate() public method

public translate ( &$field )
$field

translateFields() public method

Translate the label/title item of $fields.
public translateFields ( array | Field $fields )
$fields array | Jarves\Configuration\Field

update() public method

Updates a object entry. This means, all fields which are not defined will be saved as NULL.
public update ( array $pk, Request | array $requestOrData ) : boolean
$pk array
$requestOrData Symfony\Component\HttpFoundation\Request | array
return boolean

Property Details

$_fields protected property

Flatten list of fields.
protected Field[],Jarves\Configuration $_fields
return Jarves\Configuration\Field[]

$acl protected property

protected ACL,Jarves $acl
return Jarves\ACL

$add protected property

Defines whether the add button should be displayed
protected bool $add
return boolean

$addEntrypoint protected property

Default is /. Relative or absolute paths are allowed. Empty means current entrypoint.
protected string $addEntrypoint
return string

$addIcon protected property

Defines the icon for the add button. Relative to media/ or #className for vector images
protected $addIcon

$addMultiple protected property

protected $addMultiple

$addMultipleFieldContainerWidth protected property

protected $addMultipleFieldContainerWidth

$addMultipleFields protected property

protected $addMultipleFields

$addMultipleFixedFields protected property

protected $addMultipleFixedFields

$allowCustomFieldSelection protected property

(?fields=...)
protected bool $allowCustomFieldSelection
return boolean

$asNested protected property

Is automatically set when object property is defined.
protected bool $asNested
return boolean

$columns protected property

This is used by the listing crud window (and GET of the REST api) Only one level, no children, no tabs. Use the crud editor, to get the list of possible types.
protected array $columns
return array

$conditionOperator protected property

protected ConditionOperator,Jarves $conditionOperator
return Jarves\ConditionOperator

$customOrderBy protected property

Order field
protected string $customOrderBy
return string

$defaultLimit protected property

Defines how many items should be displayed per page.
protected $defaultLimit

$domain protected property

The current domain id to filter if domainDepended is enabled.
protected int $domain
return integer

$domainDepended protected property

Note: Your table need a field 'domain_id' int. The windowList class filter by this.
protected bool $domainDepended
return boolean

$edit protected property

Defines whether the edit button should be displayed
protected bool $edit
return boolean

$editEntrypoint protected property

Default is /. Relative or absolute paths are allowed. Empty means current entrypoint.
protected string $editEntrypoint
return string

$editIcon protected property

Defines the icon for the edit button. Relative to media/ or #className for vector images
protected $editIcon

$eventDispatcher protected property

protected EventDispatcherInterface,Symfony\Component\EventDispatcher $eventDispatcher
return Symfony\Component\EventDispatcher\EventDispatcherInterface

$extraSelection protected property

Only field names allowed that are available by the underlying object. Comma separated or as array.
protected string|array $extraSelection
return string | array

$fields protected property

Can contains several fields nested, via 'children', also type 'tab' are allowed. Every jarves.field is allowed.
protected array $fields
return array

$filter protected property

Contains the fields for the search.
protected array $filter
return array

$filterFields protected property

protected array $filterFields
return array

$itemLayout protected property

protected string $itemLayout
return string

$itemsPerPage protected property

protected int $itemsPerPage
return integer

$jarves protected property

protected Jarves,Jarves $jarves
return Jarves\Jarves

$language protected property

The current language to filter if multiLanguage is enabled.
protected string $language
return string

$multiLanguage protected property

Note: Your table need a field 'lang' varchar(2). The windowList class filter by this. If the object is nested=true and have a root object
protected bool $multiLanguage
return boolean

$nestedAddWithPositionSelection protected property

protected $nestedAddWithPositionSelection

$nestedMoveable protected property

protected $nestedMoveable

$nestedRootAdd protected property

protected $nestedRootAdd

$nestedRootAddEntrypoint protected property

protected $nestedRootAddEntrypoint

$nestedRootAddIcon protected property

protected $nestedRootAddIcon

$nestedRootAddLabel protected property

protected $nestedRootAddLabel

$nestedRootEdit protected property

protected $nestedRootEdit

$nestedRootEditEntrypoint protected property

protected $nestedRootEditEntrypoint

$nestedRootRemove protected property

protected $nestedRootRemove

$nestedRootRemoveEntrypoint protected property

protected $nestedRootRemoveEntrypoint

$newLabel protected property

protected $newLabel

$object protected property

Defines the object which should be used.
protected $object

$objectBased protected property

Whether this CRUD view is based on a object with an id.
protected bool $objectBased
return boolean

$objectDefinition protected property

Copy of the object definition, by is being set in the initialisation. Only set when object property is defined.
protected Object,Jarves\Configuration $objectDefinition
return Jarves\Configuration\Object

$objects protected property

protected Objects,Jarves $objects
return Jarves\Objects

$order protected property

array( array('field' => 'group_id', 'direction' => 'asc'), array('field' => 'title', 'direction' => 'asc') ); or array( 'group_id' => 'asc', 'title' => 'desc' )
protected array $order
return array

$orderBy protected property

Order field
protected string $orderBy
return string

$orderByDirection protected property

Order direction
protected string $orderByDirection
return string

$permissionCheck protected property

Deactivate this means this object does not listen to any ACL.
protected bool $permissionCheck
return boolean

$primary protected property

Example: $primary = array('id'); Example: $primary = array('id', 'name'); Use this only if you know, what you're doing, normally this comes from the object settings.
protected array $primary
return array

$primaryKey protected property

If the class created a item through addItem(), it contains the primary key of the newly created item. array( 'id' => 1234 ) array( 'id' => 1234, 'subId' => 5678 )
See also: getPrimaryKey()
protected array $primaryKey
return array

$remove protected property

Defines whether the remove/delete button should be displayed Also on each row the Delete-Button and the checkboxes.
protected bool $remove
return boolean

$removeEntrypoint protected property

protected string $removeEntrypoint
return string

$removeIcon protected property

Defines the icon for the remove/delete button. Relative to media/ or #className for vector images
protected $removeIcon

$removeIconItem protected property

Defines the icon for the remove/delete button. Relative to media/ or #className for vector images
protected $removeIconItem

$requestStack protected property

protected RequestStack,Symfony\Component\HttpFoundation $requestStack
return Symfony\Component\HttpFoundation\RequestStack

$startCombine protected property

protected $startCombine

$table protected property

Use this only if you know, what you're doing, normally this comes from the object definition from the object property.
protected $table

$translator protected property

protected Translator,Jarves\Translation $translator
return Jarves\Translation\Translator

$usePatch protected property

'PUT' requires that you send all field, and 'PATCH' only the fields that need to be updated.
protected bool $usePatch
return boolean

$utils protected property

protected Utils,Jarves $utils
return Jarves\Utils

$withNewsFeed protected property

protected bool $withNewsFeed
return boolean

$workspace protected property

Needs a column workspace_id in the table or active workspace at object.
protected bool $workspace
return boolean