Tripal
Public Member Functions | Protected Attributes | List of all members
TripalWebServiceCollection Class Reference
Inheritance diagram for TripalWebServiceCollection:
Inheritance graph
[legend]
Collaboration diagram for TripalWebServiceCollection:
Collaboration graph
[legend]

Public Member Functions

 __construct ($service_path, $params)
 
 initPager ($totalItems, $itemsPerPage, $page)
 
 addMember ($member)
 
 setType ($type)
 
 getData ()
 
 getContext ()
 
- Public Member Functions inherited from TripalWebServiceResource
 disbleType ()
 
 enableType ()
 
 disableID ()
 
 enableID ()
 
 __construct ($service_path)
 
 addContextItem ($name, $iri)
 
 removeContextItem ($name, $iri)
 
 setServicePath ($service_path)
 
 setID ($id)
 
 getURI ($id)
 
 getID ()
 
 getType ()
 
 addProperty ($key, $value)
 
 getProperty ($key)
 
 setContext ($resource)
 

Protected Attributes

 $members
 
 $doPaging
 
 $totalItems
 
 $itemsPerPage
 
 $page
 
 $params
 
- Protected Attributes inherited from TripalWebServiceResource
 $id
 
 $type
 
 $context
 
 $data
 
 $service_path
 
 $disable_type = FALSE
 
 $disable_id = FALSE
 

Constructor & Destructor Documentation

◆ __construct()

TripalWebServiceCollection::__construct (   $service_path,
  $params 
)

Implements the constructor.

Parameters
TripalWebService$serviceAn instance of a TripalWebService or class that extends it.

Member Function Documentation

◆ addMember()

TripalWebServiceCollection::addMember (   $member)

Adds a new member to this resource if it is a collection.

Parameters
$memberA TripalWebServiceResource member whose type is the same as this resource

◆ getContext()

TripalWebServiceCollection::getContext ( )

Retrieves the data section of the resource.

The JSON-LD response constists of two sections the '@context' section and the data section. This function only returns the data section for this resource

Returns
An associative array containing the data section of the response.

Reimplemented from TripalWebServiceResource.

◆ getData()

TripalWebServiceCollection::getData ( )

Retrieves the data section of the resource.

The JSON-LD response constists of two sections the '@context' section and the data section. This function only returns the data section for this resource

Returns
An associative array containing the data section of the response.

Reimplemented from TripalWebServiceResource.

◆ initPager()

TripalWebServiceCollection::initPager (   $totalItems,
  $itemsPerPage,
  $page 
)

Initializes the pager.

Parameters
$totalItemsThe total number of items available.
$itemsPerPageThe maximum number of items per page.
$pathThe path

◆ setType()

TripalWebServiceCollection::setType (   $type)

Member Data Documentation

◆ $doPaging

TripalWebServiceCollection::$doPaging
protected

Set to TRUE if paging should be enabled. Paging is disabled by default.

◆ $itemsPerPage

TripalWebServiceCollection::$itemsPerPage
protected

When the collection contains more than the itemsPerpage amount then the results will be paged.

◆ $members

TripalWebServiceCollection::$members
protected

Holds the data portion of the JSON-LD response if this resource is a collection.

◆ $page

TripalWebServiceCollection::$page
protected

The current page of the pager.

◆ $params

TripalWebServiceCollection::$params
protected

The parameters as collected by the parent TripalWebService. We need the parameters because this Resource generates first, next, prev, and last links and we need to maintain the parameters a user may have provided in those links.

◆ $totalItems

TripalWebServiceCollection::$totalItems
protected

The total number of items. This variable is used if paging is turned on. Otherwise it's ignored and the total number of items reported by the collection will be the number of elements in the $members array.


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