Property | Type | Description | |
---|---|---|---|
$_fields | Flatten list of fields. | ||
$acl | |||
$add | boolean | Defines whether the add button should be displayed | |
$addEntrypoint | string | Default is |
|
$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 | |||
$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 |
|
$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 | |||
$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 | Copy of the object definition, by is being set in the initialisation. Only set when object property is defined. | ||
$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 | |||
$usePatch | boolean | 'PUT' requires that you send all field, and 'PATCH' only the fields that need to be updated. | |
$utils | |||
$withNewsFeed | boolean | ||
$workspace | boolean | Needs a column workspace_id in the table or active workspace at object. |
Method | Description | |
---|---|---|
__construct ( |
ObjectCrud constructor. | |
add ( |
Adds a new item. | |
addMultiple ( |
Adds multiple entries. | |
buildFilter ( array $filter ) : array | null | ||
collectData ( |
||
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 ( ) : |
Here you can define additional conditions for all operations (edit/listing). | |
getCount ( |
||
getCustomEditCondition ( ) : |
Here you can define additional conditions for edit operations. | |
getCustomListingCondition ( ) : |
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 ( ) : |
||
getFilter ( ) : array | ||
getFilterFields ( ) | ||
getInfo ( ) | ||
getInitializedFields ( ) : |
||
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 ( ) : |
||
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, |
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 ( |
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 ( |
||
translate ( &$field ) | ||
translateFields ( array | |
Translate the label/title item of $fields. | |
update ( array $pk, |
Updates a object entry. This means, all fields which are not defined will be saved as NULL. |
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 ) |
public __construct ( |
||
$translator | ||
$objects | ||
$jarves | ||
$requestStack | Symfony\Component\HttpFoundation\RequestStack | |
$conditionOperator | ||
$acl | ||
$eventDispatcher | Symfony\Component\EventDispatcher\EventDispatcherInterface | |
$utils |
public add ( |
||
$requestOrData | ||
$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. |
public addMultiple ( |
||
$request | ||
return | array | mixed |
protected applyDefaultSelection ( array $fields ) : array | ||
$fields | array | |
return | array |
public collectData ( |
||
$requestData | *@return array | |
return | array |
protected convertToFieldObjects ( array &$fields ) | ||
$fields | array |
protected ensureLanguageField ( ) |
public getAllowCustomFieldSelection ( ) : boolean | ||
return | boolean |
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 |
public getCondition ( ) : |
||
return | definition |
public getCustomEditCondition ( ) : |
||
return | definition |
public getCustomListingCondition ( ) : |
||
return | definition |
public getDefaultFieldList ( ) : array | ||
return | array |
public getInitializedFields ( ) : |
||
return |
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 |
public getLanguage ( ) : string | ||
return | string |
public getObjectDefinition ( ) : |
||
return |
public getPrimaryKey ( ) : array | ||
return | array |
public getTreeFields ( string $fields = null ) : array | ||
$fields | string | |
return | array |
public initialize ( boolean $withoutObjectCheck = false ) | ||
$withoutObjectCheck | boolean |
public moveItem ( $pk, $targetPk, $position = 'first', $targetObjectKey = '' ) |
public prepareFieldDefinition ( array &$fields ) | ||
$fields | array |
public prepareFieldItem ( |
||
$fields |
public prepareRow ( array &$item ) : array | ||
$item | array | |
return | array |
public setAddEntrypoint ( string $addEntrypoint ) | ||
$addEntrypoint | string |
public setAddMultipleFieldContainerWidth ( $addMultipleFieldContainerWidth ) |
public setAddMultipleFixedFields ( $addMultipleFixedFields ) |
public setAllowCustomFieldSelection ( boolean $allowExtraFieldSelection ) | ||
$allowExtraFieldSelection | boolean |
public setCustomOrderBy ( string $customOrderBy ) | ||
$customOrderBy | string |
public setDefaultLimit ( integer $defaultLimit ) | ||
$defaultLimit | integer |
public setDomainDepended ( boolean $domainDepended ) | ||
$domainDepended | boolean |
public setEditEntrypoint ( string $editEntrypoint ) | ||
$editEntrypoint | string |
public setExtraSelection ( array | string $selection ) | ||
$selection | array | string |
public setItemsPerPage ( integer $itemsPerPage ) | ||
$itemsPerPage | integer |
public setMultiLanguage ( boolean $multiLanguage ) | ||
$multiLanguage | boolean |
public setNestedAddWithPositionSelection ( $nestedAddWithPositionSelection ) |
public setNestedRootAddEntrypoint ( $nestedRootAddEntrypoint ) |
public setNestedRootEditEntrypoint ( $nestedRootEditEntrypoint ) |
public setNestedRootRemoveEntrypoint ( $nestedRootRemoveEntrypoint ) |
public setObjectDefinition ( array $objectDefinition ) | ||
$objectDefinition | array |
public setOrderByDirection ( string $orderByDirection ) | ||
$orderByDirection | string |
public setPermissionCheck ( boolean $permissionCheck ) | ||
$permissionCheck | boolean |
public setRemoveIconItem ( string $removeIconItem ) | ||
$removeIconItem | string |
public setStartCombine ( boolean $startCombine ) | ||
$startCombine | boolean |
public setWithNewsFeed ( boolean $withNewsFeed ) | ||
$withNewsFeed | boolean |
public toIdIndex ( |
||
$fieldArray |
public translateFields ( array | |
||
$fields | array | |
protected Field[],Jarves\Configuration $_fields | ||
return |
protected bool $add | ||
return | boolean |
protected string $addEntrypoint | ||
return | string |
protected $addIcon |
protected bool $allowCustomFieldSelection | ||
return | boolean |
protected bool $asNested | ||
return | boolean |
protected array $columns | ||
return | array |
protected ConditionOperator,Jarves $conditionOperator | ||
return |
protected $defaultLimit |
protected int $domain | ||
return | integer |
protected bool $domainDepended | ||
return | boolean |
protected bool $edit | ||
return | boolean |
protected string $editEntrypoint | ||
return | string |
protected $editIcon |
protected EventDispatcherInterface,Symfony\Component\EventDispatcher $eventDispatcher | ||
return | Symfony\Component\EventDispatcher\EventDispatcherInterface |
protected array $fields | ||
return | array |
protected string $language | ||
return | string |
protected bool $multiLanguage | ||
return | boolean |
protected bool $objectBased | ||
return | boolean |
protected Object,Jarves\Configuration $objectDefinition | ||
return |
protected array $order | ||
return | array |
protected string $orderByDirection | ||
return | string |
protected bool $permissionCheck | ||
return | boolean |
protected array $primary | ||
return | array |
protected array $primaryKey | ||
return | array |
protected bool $remove | ||
return | boolean |
protected $removeIcon |
protected $removeIconItem |
protected RequestStack,Symfony\Component\HttpFoundation $requestStack | ||
return | Symfony\Component\HttpFoundation\RequestStack |
protected $table |
protected Translator,Jarves\Translation $translator | ||
return |
protected bool $usePatch | ||
return | boolean |
protected bool $workspace | ||
return | boolean |