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

Generic base controller for content listing and content view/edit/add. More...

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

Public Member Functions

 __invoke (\Elgg\Request $request)
 Handle a request. More...
 

Protected Member Functions

 assertValidRoute ()
 Validate that route is supported. More...
 
 handleRequest (\Elgg\Request $request)
 Handle the request. More...
 
 getPageOptions (string $page, array $options)
 Get additional options to use when viewing a page. More...
 
 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...
 
 getPage ()
 Get the page from the route name. More...
 

Protected Attributes

Elgg Request $request = null
 
Elgg Router Route $route = null
 
array $route_parts = null
 

Detailed Description

Generic base controller for content listing and content view/edit/add.

Since
7.1

Definition at line 14 of file GenericContent.php.

Member Function Documentation

◆ __invoke()

Elgg\Controllers\GenericContent::__invoke ( \Elgg\Request  $request)
final

Handle a request.

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

Definition at line 30 of file GenericContent.php.

◆ assertValidRoute()

Elgg\Controllers\GenericContent::assertValidRoute ( )
abstractprotected

Validate that route is supported.

Returns
void
Exceptions
ValidationException

Reimplemented in Elgg\Controllers\GenericEntity, and Elgg\Controllers\GenericContentListing.

◆ getEntitySubtype()

Elgg\Controllers\GenericContent::getEntitySubtype ( )
protected

Get the entity subtype from the route name.

eq. 'collection:object:blog:all' => 'blog' eq. 'view:object:blog' => 'blog'

Returns
string
Exceptions
ValidationException

Definition at line 116 of file GenericContent.php.

◆ getEntityType()

Elgg\Controllers\GenericContent::getEntityType ( )
protected

Get the entity type from the route name.

eq. 'collection:object:blog:all' => 'object' eq. 'view:object:blog' => 'object'

Returns
string
Exceptions
ValidationException

Definition at line 103 of file GenericContent.php.

◆ getPage()

Elgg\Controllers\GenericContent::getPage ( )
abstractprotected

Get the page from the route name.

Returns
string
Exceptions
ValidationException

Reimplemented in Elgg\Controllers\GenericEntity, and Elgg\Controllers\GenericContentListing.

◆ getPageOptions()

Elgg\Controllers\GenericContent::getPageOptions ( string  $page,
array  $options 
)
abstractprotected

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 in Elgg\Controllers\GenericEntity, and Elgg\Controllers\GenericContentListing.

◆ getRouteParts()

Elgg\Controllers\GenericContent::getRouteParts ( )
finalprotected

Parse the route name to usable parts.

Returns
array
Exceptions
ValidationException

Definition at line 75 of file GenericContent.php.

◆ handleRequest()

Elgg\Controllers\GenericContent::handleRequest ( \Elgg\Request  $request)
abstractprotected

Handle the request.

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

Reimplemented in Elgg\Controllers\GenericEntity, and Elgg\Controllers\GenericContentListing.

Member Data Documentation

◆ $request

Elgg Request Elgg\Controllers\GenericContent::$request = null
protected

Definition at line 16 of file GenericContent.php.

◆ $route

Elgg Router Route Elgg\Controllers\GenericContent::$route = null
protected

Definition at line 18 of file GenericContent.php.

◆ $route_parts

array Elgg\Controllers\GenericContent::$route_parts = null
protected

Definition at line 20 of file GenericContent.php.


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