Elgg  Version 7.1
Protected Member Functions | Protected Attributes | List of all members
Elgg\Controllers\GenericEntity Class Reference

Generic controller to handle entity view/edit/add routes. More...

Inheritance diagram for Elgg\Controllers\GenericEntity:
Elgg\Controllers\GenericContent

Protected Member Functions

 handleRequest (\Elgg\Request $request)
 {Handle the request.
Parameters
\Elgg\Request$requestthe Elgg request
Returns
Response
Exceptions
HttpException
} More...
 
 assertValidRoute ()
 {Validate that route is supported.
Returns
void
Exceptions
ValidationException
} More...
 
 getPage ()
 {Get the page from the route name.
Returns
string
Exceptions
ValidationException
} More...
 
 getEntity (bool $validate_can_edit=false)
 Get the entity from the request. More...
 
 prepareBreadcrumbs ()
 Prepare breadcrumbs. More...
 
 getPageOptions (string $page, array $options)
 {Get additional options to use when viewing a page.
Parameters
string$pagefor which page to get the options ('all', 'owner', 'group', 'friends', 'view', 'add', etc.)
array$optionscurrent page options
Returns
array
See also
elgg_view_page()
} More...
 
 addEntity ()
 Render an entity add page. More...
 
 editEntity ()
 Render an entity edit page. More...
 
 viewEntity ()
 Render the entity view page. More...
 
- Protected Member Functions inherited from Elgg\Controllers\GenericContent
 getRouteParts ()
 Parse the route name to usable parts. More...
 
 getEntityType ()
 Get the entity type from the route name. More...
 
 getEntitySubtype ()
 Get the entity subtype from the route name. More...
 

Protected Attributes

ElggEntity $entity = null
 
- Protected Attributes inherited from Elgg\Controllers\GenericContent
Elgg Request $request = null
 
Elgg Router Route $route = null
 
array $route_parts = null
 

Additional Inherited Members

- Public Member Functions inherited from Elgg\Controllers\GenericContent
 __invoke (\Elgg\Request $request)
 Handle a request. More...
 

Detailed Description

Generic controller to handle entity view/edit/add routes.

Since
7.1

Definition at line 15 of file GenericEntity.php.

Member Function Documentation

◆ addEntity()

Elgg\Controllers\GenericEntity::addEntity ( )
protected

Render an entity add page.

Returns
string
Exceptions
HttpException

Definition at line 144 of file GenericEntity.php.

◆ assertValidRoute()

Elgg\Controllers\GenericEntity::assertValidRoute ( )
protected

{Validate that route is supported.

Returns
void
Exceptions
ValidationException
}

Reimplemented from Elgg\Controllers\GenericContent.

Definition at line 36 of file GenericEntity.php.

◆ editEntity()

Elgg\Controllers\GenericEntity::editEntity ( )
protected

Render an entity edit page.

Returns
string
Exceptions
HttpException

Definition at line 163 of file GenericEntity.php.

◆ getEntity()

Elgg\Controllers\GenericEntity::getEntity ( bool  $validate_can_edit = false)
protected

Get the entity from the request.

Parameters
bool$validate_can_editflag to check canEdit access
Returns
\ElggEntity
Exceptions
HttpException

Definition at line 59 of file GenericEntity.php.

◆ getPage()

Elgg\Controllers\GenericEntity::getPage ( )
protected

{Get the page from the route name.

Returns
string
Exceptions
ValidationException
}

Reimplemented from Elgg\Controllers\GenericContent.

Definition at line 47 of file GenericEntity.php.

◆ getPageOptions()

Elgg\Controllers\GenericEntity::getPageOptions ( string  $page,
array  $options 
)
protected

{Get additional options to use when viewing a page.

Parameters
string$pagefor which page to get the options ('all', 'owner', 'group', 'friends', 'view', 'add', etc.)
array$optionscurrent page options
Returns
array
See also
elgg_view_page()
}

Reimplemented from Elgg\Controllers\GenericContent.

Definition at line 98 of file GenericEntity.php.

◆ handleRequest()

Elgg\Controllers\GenericEntity::handleRequest ( \Elgg\Request  $request)
finalprotected

{Handle the request.

Parameters
\Elgg\Request$requestthe Elgg request
Returns
Response
Exceptions
HttpException
}

Reimplemented from Elgg\Controllers\GenericContent.

Definition at line 22 of file GenericEntity.php.

◆ prepareBreadcrumbs()

Elgg\Controllers\GenericEntity::prepareBreadcrumbs ( )
protected

Prepare breadcrumbs.

Returns
void
Exceptions
HttpException

Definition at line 77 of file GenericEntity.php.

◆ viewEntity()

Elgg\Controllers\GenericEntity::viewEntity ( )
protected

Render the entity view page.

Returns
string
Exceptions
HttpException

Definition at line 179 of file GenericEntity.php.

Member Data Documentation

◆ $entity

ElggEntity Elgg\Controllers\GenericEntity::$entity = null
protected

Definition at line 17 of file GenericEntity.php.


The documentation for this class was generated from the following file: