|
| hasResources () |
|
| getPropertyDefinitions ($excluded_properties=[]) |
|
| getGroupedPropertyDefinitions ($excluded_properties=[]) |
|
| addProperty ( $name='', $type='bool', $requestable=false, $protected=false, $write_permission_level='autor') |
|
| createResource ( $name='', $description='', $parent_id='', $properties=[], $ignore_invalid=false) |
|
| createDefinedResourceProperty (Resource $resource, $name, $state=null) |
|
| createDefinedResourceRequestProperty (ResourceRequest $request, $name, $state=null) |
|
| getRequestableProperties () |
|
| hasProperty ($name='', $type=null) |
|
| userHasPropertyWritePermissions (string $name, User $user, $resource=null) |
|
| getIcon ($role=Icon::ROLE_INFO) |
|
| __construct ($id=null) |
|
| __clone () |
|
| getRelationOptions ($relation) |
|
| getTableMetadata () |
|
| hasAutoIncrementColumn () |
|
| setId ($id) |
|
| getId () |
|
| getNewId () |
|
| toArray ($only_these_fields=null) |
|
| toRawArray ($only_these_fields=null) |
|
| toArrayRecursive ($only_these_fields=null) |
|
| getValue ($field) |
|
| getRelationValue ($relation, $field) |
|
| getDefaultValue ($field) |
|
| setValue ($field, $value) |
|
| __get ($field) |
|
| __set ($field, $value) |
|
| __isset ($field) |
|
| offsetExists ($offset) |
|
| offsetGet ($offset) |
|
| offsetSet ($offset, $value) |
|
| offsetUnset ($offset) |
|
| getIterator () |
|
| count () |
|
| isField ($field) |
|
| isRelation ($field) |
|
| isAdditionalField ($field) |
|
| isAliasField ($field) |
|
| isI18nField ($field) |
|
| setData ($data, $reset=false) |
|
| isNew () |
|
| isDeleted () |
|
| setNew ($is_new) |
|
| getWhereQuery () |
|
| restore () |
|
| store () |
|
| triggerChdate () |
|
| delete () |
|
| isDirty () |
|
| isFieldDirty ($field) |
|
| revertValue ($field) |
|
| getPristineValue ($field) |
|
| initRelation ($relation) |
|
| resetRelation ($relation) |
|
| cleanup () |
|
|
static | findAll ($force_reload=false) |
|
static | find ($id) |
|
static | getClassNameById ($category_id) |
|
static | tableScheme ($db_table) |
|
static | expireTableScheme () |
|
static | exists ($id) |
|
static | countBySql ($sql='1', $params=[]) |
|
static | create ($data) |
|
static | build ($data, $is_new=true) |
|
static | buildExisting ($data) |
|
static | import ($data) |
|
static | findBySQL ($sql, $params=[]) |
|
static | findOneBySQL ($where, $params=[]) |
|
static | findThru ($foreign_key_value, $options) |
|
static | findEachBySQL ($callable, $sql, $params=[]) |
|
static | findMany ($pks=[], $order='', $order_params=[]) |
|
static | findEachMany ($callable, $pks=[], $order='', $order_params=[]) |
|
static | findAndMapBySQL ($callable, $where, $params=[]) |
|
static | findAndMapMany ($callable, $pks=[], $order='', $order_params=[]) |
|
static | deleteBySQL ($where, $params=[]) |
|
static | toObject ($id_or_object) |
|
static | __callStatic (string $name, array $arguments) |
|
◆ addProperty()
addProperty |
( |
|
$name = '' , |
|
|
|
$type = 'bool' , |
|
|
|
$requestable = false , |
|
|
|
$protected = false , |
|
|
|
$write_permission_level = 'autor' |
|
) |
| |
Adds a property to this category. If the property doesn't exist it will be created.
- Parameters
-
string | $name | The name of the property. |
string | $type | The type of the property. |
bool | $requestable | Whether the property is requestable or not. Defaults to false. |
bool | $protected | Whether the property is protected or not. Defaults to false. |
string | $write_permission_level | |
- Returns
- ResourceCategoryProperty The created or updated resource category property.
- Exceptions
-
◆ configure()
static configure |
( |
|
$config = [] | ) |
|
|
staticprotected |
◆ createDefinedResourceProperty()
createDefinedResourceProperty |
( |
Resource |
$resource, |
|
|
|
$name, |
|
|
|
$state = null |
|
) |
| |
◆ createDefinedResourceRequestProperty()
createDefinedResourceRequestProperty |
( |
ResourceRequest |
$request, |
|
|
|
$name, |
|
|
|
$state = null |
|
) |
| |
◆ createResource()
createResource |
( |
|
$name = '' , |
|
|
|
$description = '' , |
|
|
|
$parent_id = '' , |
|
|
|
$properties = [] , |
|
|
|
$ignore_invalid = false |
|
) |
| |
Creates a resource object which belongs to this category. All properties which are mandatory for resources of this category are set to default values unless they are specified in the properties array.
- Parameters
-
string | $name | The name of the new resource. |
string | $description | The description of the new resource. |
string | $parent_id | The parent resource's ID (if any). |
array | $properties | An associative array in the form [$key] = $value containing the defined properties which can be set to this resource. |
bool | $ignore_invalid | If set to true, invalid values or invalid property names are ignored and no exception is thrown if an invalid value or property name occurs. Instead an invalid valud will be replaced with a default value and an invalid property name will not result in a set property. |
- Returns
- Resource New Resource object which is a member of this resource category.
- Exceptions
-
◆ find()
◆ findAll()
static findAll |
( |
|
$force_reload = false | ) |
|
|
static |
Retrieves all resource categories from the database.
- Parameters
-
- Returns
- ResourceCategory[] An array of ResourceCategory objects or an empty array if no resource categories are defined.
◆ getClassNameById()
static getClassNameById |
( |
|
$category_id | ) |
|
|
static |
"Converts" a category-ID to a class name by looking up the class name of a specified category.
- Parameters
-
string | $category_id | The category-ID of the specified category. |
- Returns
- string The class name field of the category which is specified by $category_id. In case no category could be found, an empty string is returned.
◆ getGroupedPropertyDefinitions()
getGroupedPropertyDefinitions |
( |
|
$excluded_properties = [] | ) |
|
This method returns the same properties as getPropertyDefinitions, but grouped and ordered by the property groups and the position of the property in that group.
- Returns
- array An array with the group names as keys and the properties in the second array dimension. The structure of the array is as follows: [ group1 name => [ property1, property2, ... ], group2 name => [ ... ] ]
◆ getIcon()
Get the icon of a category
- Parameters
-
- Returns
- Icon
◆ getPropertyDefinitions()
getPropertyDefinitions |
( |
|
$excluded_properties = [] | ) |
|
Retrieves the definitions of all properties that are available for this resource category.
- Parameters
-
string[] | excluded_properties An array with the names of the properties that shall be excluded from the result set. |
- Returns
- ResourcePropertyDefinition[] An array of resource property definitions.
◆ getRequestableProperties()
getRequestableProperties |
( |
| ) |
|
◆ hasProperty()
hasProperty |
( |
|
$name = '' , |
|
|
|
$type = null |
|
) |
| |
Determines if this resource category has a property with the specified name and type.
- Parameters
-
string | $name | The requested property name. |
string | $type | The requested property type (optional). |
- Returns
- bool True, if a property with the specified name and type exists, false otherwise.
◆ hasResources()
◆ setPropertyDefaultState()
Returns the default state for a resource property. Depending on the type of the resource property different state is returned.
- Parameters
-
- Returns
- mixed The default state for the property type, specified by the given property definition.
◆ userHasPropertyWritePermissions()
userHasPropertyWritePermissions |
( |
string |
$name, |
|
|
User |
$user, |
|
|
|
$resource = null |
|
) |
| |
Determines if the user has write permissions for the resource property specified by its name.
- Parameters
-
| string | The name of the resource property definition. |
User | $user | The user whose permissions shall be checked. |
Resource | null | $resource | An optional resource that shall be used to check for non-global permissions. |
- Returns
- bool True, if the user has write permissions, false otherwise.
- Exceptions
-
The documentation for this class was generated from the following file: