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

Generic controller to handle entity listing routes. More...

Public Member Functions

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

Protected Member Functions

 parseRoute (string $route_name)
 Parse the route name to usable parts. More...
 
 getGroupToolOption ()
 Get the name of the group tool option for group routes. More...
 
 getListingOptions (string $page, array $options)
 Get additional options to use for elgg_list_entities() More...
 
 getPageOptions (string $page, array $options)
 Get additional options to use when viewing a page. More...
 
 listAll (array $options)
 All content item listing. More...
 
 listFriends (array $options)
 Friends content item listing. More...
 
 listGroup (array $options)
 Group content item listing. More...
 
 listOwner (array $options)
 Owner content item listing. More...
 

Protected Attributes

Elgg Request $request = null
 
Elgg Router Route $route = null
 
ElggEntity $page_owner = null
 

Detailed Description

Generic controller to handle entity listing routes.

Since
7.0

Definition at line 14 of file GenericContentListing.php.

Member Function Documentation

◆ __invoke()

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

Handle a listing request.

Parameters
\Elgg\Request$requestthe Elgg request
Returns
\Elgg\Http\Response
Exceptions
ValidationException

Definition at line 30 of file GenericContentListing.php.

◆ getGroupToolOption()

Elgg\Controllers\GenericContentListing::getGroupToolOption ( )
protected

Get the name of the group tool option for group routes.

Returns
string|null

Definition at line 83 of file GenericContentListing.php.

◆ getListingOptions()

Elgg\Controllers\GenericContentListing::getListingOptions ( string  $page,
array  $options 
)
protected

Get additional options to use for elgg_list_entities()

Parameters
string$pagefor which page to get the options ('all', 'owner', 'group', 'friends')
array$optionsoptions based on the route information
Returns
array
See also
elgg_list_entities()

Definition at line 96 of file GenericContentListing.php.

◆ getPageOptions()

Elgg\Controllers\GenericContentListing::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')
array$optionscurrent page options
Returns
array
See also
elgg_view_page()

Definition at line 109 of file GenericContentListing.php.

◆ listAll()

Elgg\Controllers\GenericContentListing::listAll ( array  $options)
protected

All content item listing.

for the routes:

  • default:<type>:<subtype>
  • collection:<type>:<subtype>:all
Parameters
array$optionslisting options
Returns
string

Definition at line 132 of file GenericContentListing.php.

◆ listFriends()

Elgg\Controllers\GenericContentListing::listFriends ( array  $options)
protected

Friends content item listing.

for the route:

  • collection:<type>:<subtype>:friends
Parameters
array$optionslisting options
Returns
string
Exceptions
BadRequestException

Definition at line 156 of file GenericContentListing.php.

◆ listGroup()

Elgg\Controllers\GenericContentListing::listGroup ( array  $options)
protected

Group content item listing.

for the route:

  • collection:<type>:<subtype>:group
Parameters
array$optionslisting options
Returns
string
Exceptions
BadRequestException
GroupToolGatekeeperException

Definition at line 192 of file GenericContentListing.php.

◆ listOwner()

Elgg\Controllers\GenericContentListing::listOwner ( array  $options)
protected

Owner content item listing.

for the route:

  • collection:<type>:<subtype>:owner
Parameters
array$optionslisting options
Returns
string
Exceptions
BadRequestException

Definition at line 232 of file GenericContentListing.php.

◆ parseRoute()

Elgg\Controllers\GenericContentListing::parseRoute ( string  $route_name)
finalprotected

Parse the route name to usable parts.

Parameters
string$route_nameroute name
Returns
array
Exceptions
ValidationException

Definition at line 61 of file GenericContentListing.php.

Member Data Documentation

◆ $page_owner

ElggEntity Elgg\Controllers\GenericContentListing::$page_owner = null
protected

Definition at line 20 of file GenericContentListing.php.

◆ $request

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

Definition at line 16 of file GenericContentListing.php.

◆ $route

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

Definition at line 18 of file GenericContentListing.php.


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