Property | Type | Description | |
---|---|---|---|
$children | An array with the children referencing the entity. All entries are arrays with three referencing elements: table, fieldName, entity | ||
$childrenLabelFields | The keys are the entity names as in the CRUD YAML and the values are the field names. | ||
$deleteCascade | Whether to delete its children when an instance is deleted. | ||
$fields | Holds all fields in the same structure as in the CRUD YAML file. | ||
$filter | The fields offering to be filtered. | ||
$initialSortAscending | Holds the initial sort order. | ||
$initialSortField | Holds the initial sort field. | ||
$label | The label for the entity. | ||
$listFields | An array containing the fields which should appear in the list view of the entity. | ||
$locale | Holds the locale. | ||
$localeLabels | The labels of the entity in the locales. | ||
$pageSize | The amount of items to display per page on the listview. | ||
$serviceProvider | Holds the {@see ServiceProvider}. | ||
$standardFieldLabels | Labels for the fields "id", "created_at" and "updated_at". | ||
$table | The table where the data is stored. |
Method | Description | |
---|---|---|
__construct ( string $table, array $fields, string $label, array $localeLabels, array $standardFieldLabels, |
Constructor. | |
addChild ( string $table, string $fieldName, string $entity ) | Adds a child to this definition in case the other definition has a reference to this one. | |
getChildren ( ) : array | Gets the referencing children to this definition. | |
getChildrenLabelFields ( ) : array | Gets the fields used to display the children on the details page of an entity. The keys are the entity names as in the CRUD YAML and the values are the field names. | |
getEditableFieldNames ( ) : array | Gets the field names which are editable. Not editable are fields like the id or the created_at. | |
getField ( string $name, string $key, mixed $default = null ) : mixed | Gets the value of a field key. | |
getFieldLabel ( string $fieldName ) : string | Gets the label of a field. | |
getFieldNames ( boolean $includeMany = false ) : string[] | Gets all field names, including the implicit ones like "id" or "created_at". | |
getFilter ( ) : array | Gets the fields offering a filter. | |
getInitialSortField ( ) : string | Gets the initial sort field. | |
getLabel ( ) : string | Gets the label for the entity. | |
getListFields ( ) : array | Gets the field names to be used in the listview. If they were not specified, all public field names are returned. | |
getLocale ( ) : null | string | Gets the locale to be used. | |
getPageSize ( ) : integer | Gets the amount of items to display per page on the listview. | |
getPublicFieldNames ( ) : array | Gets the public field names. The internal fields "version" and "deleted_at" are filtered. | |
getReadOnlyFields ( ) : string[] | Gets the read only field names like the id or the created_at. | |
getServiceProvider ( ) : |
Gets the service provider. | |
getSubTypeField ( string $fieldName, string $subType, string $key ) : string | Gets a sub field of an field. | |
getTable ( ) : string | Gets the table where the data is stored. | |
getType ( string $fieldName ) : string | Gets the type of a field. | |
isDeleteCascade ( ) : boolean | Gets whether to delete its children when an instance is deleted. | |
isInitialSortAscending ( ) : boolean | Gets the initial sort order. | |
setChildrenLabelFields ( array $childrenLabelFields ) | Sets the fields used to display the children on the details page of an entity. The keys are the entity names as in the CRUD YAML and the values are the field names. | |
setDeleteCascade ( boolean $deleteCascade ) | Sets whether to delete its children when an instance is deleted. | |
setField ( string $name, string $key, mixed $value ) | Sets the value of a field key. If the field or the key in the field don't exist, they get created. | |
setFieldLabel ( string $fieldName, string $value ) | Gets the label of a field. | |
setFilter ( array $filter ) | Sets the fields offering a filter. | |
setInitialSortAscending ( boolean $initialSortAscending ) | Sets the initial sort order. | |
setInitialSortField ( string $initialSortField ) | Sets the initial sort field. | |
setLabel ( string $label ) | Sets the label for the entity. | |
setListFields ( array $listFields ) | Sets the field names to be used in the listview. | |
setLocale ( string $locale ) | Sets the locale to be used. | |
setPageSize ( integer $pageSize ) | Sets the amount of items to display per page on the listview. | |
setServiceProvider ( |
Sets the service provider. | |
setTable ( string $table ) | Sets the table where the data is stored. | |
setType ( string $fieldName, string $value ) | Sets the type of a field. |
Method | Description | |
---|---|---|
checkFieldNames ( string $reference, array $fieldNames ) | Checks whether the given field names are declared and existing. | |
getFilteredFieldNames ( array $exclude ) : array | Gets the field names exluding the given ones. |
public __construct ( string $table, array $fields, string $label, array $localeLabels, array $standardFieldLabels, |
||
$table | string | the table of the entity |
$fields | array | the field structure just like the CRUD YAML |
$label | string | the label of the entity |
$localeLabels | array | the labels of the entity in the locales |
$standardFieldLabels | array | labels for the fields "id", "created_at" and "updated_at" |
$serviceProvider | The current service provider |
protected checkFieldNames ( string $reference, array $fieldNames ) | ||
$reference | string | a hint towards the source of an invalid field name |
$fieldNames | array | the field names to check |
public getChildren ( ) : array | ||
return | array | an array with the children referencing the entity. All entries are arrays with three referencing elements: table, fieldName, entity |
public getChildrenLabelFields ( ) : array | ||
return | array | the fields used to display the children on the details page |
public getEditableFieldNames ( ) : array | ||
return | array | the editable field names |
public getFieldLabel ( string $fieldName ) : string | ||
$fieldName | string | the field name |
return | string | the label of the field or the field name if no label is set in the CRUD YAML |
public getFieldNames ( boolean $includeMany = false ) : string[] | ||
$includeMany | boolean | whether to include the many fields as well |
return | string[] | the field names |
protected getFilteredFieldNames ( array $exclude ) : array | ||
$exclude | array | the field names to exclude |
return | array | all field names excluding the given ones |
public getInitialSortField ( ) : string | ||
return | string | the initial sort field |
public getListFields ( ) : array | ||
return | array | the field names to be used in the listview |
public getPageSize ( ) : integer | ||
return | integer | the amount of items to display per page on the listview |
public getPublicFieldNames ( ) : array | ||
return | array | the public field names |
public getReadOnlyFields ( ) : string[] | ||
return | string[] | the read only field names |
public getServiceProvider ( ) : |
||
return | the service provider |
public isDeleteCascade ( ) : boolean | ||
return | boolean | true if so |
public isInitialSortAscending ( ) : boolean | ||
return | boolean | the initial sort order, true if ascending |
public setChildrenLabelFields ( array $childrenLabelFields ) | ||
$childrenLabelFields | array | the fields used to display the children on the details page |
public setDeleteCascade ( boolean $deleteCascade ) | ||
$deleteCascade | boolean | whether to delete its children when an instance is deleted |
public setFieldLabel ( string $fieldName, string $value ) | ||
$fieldName | string | the field name |
$value | string | the new label of the field |
public setInitialSortAscending ( boolean $initialSortAscending ) | ||
$initialSortAscending | boolean | the initial sort order, true if ascending |
public setInitialSortField ( string $initialSortField ) | ||
$initialSortField | string | the new initial sort field |
public setListFields ( array $listFields ) | ||
$listFields | array | the field names to be used in the listview |
public setPageSize ( integer $pageSize ) | ||
$pageSize | integer | the amount of items to display per page on the listview |
public setServiceProvider ( |
||
$serviceProvider | the new service provider |
protected $children |
protected $childrenLabelFields |
protected $deleteCascade |
protected $fields |
protected $initialSortAscending |
protected $listFields |
protected $localeLabels |
protected $pageSize |
protected $standardFieldLabels |