Version 4.3.0
This commit is contained in:
1 parent
96997ddd8e
commit
fe1acf984a
1349 files changed
+116159
-67711
No files matched your search
@@ -52,6 +52,11 @@ class _PaginatedResponse extends Response
|
||||
*/
|
||||
protected $count;
|
||||
|
||||
/**
|
||||
* @brief The member making the API request or NULL for API Key / client_credentials
|
||||
*/
|
||||
protected $authorizedMember;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@@ -60,21 +65,25 @@ class _PaginatedResponse extends Response
|
||||
* @param int $page Current page
|
||||
* @param string $activeRecordClass ActiveRecord class
|
||||
* @param int $count Total Count
|
||||
* @param \IPS\Member|NULL $authorizedMember The member making the API request or NULL for API Key / client_credentials
|
||||
* @param int $perPage Number of results per page
|
||||
* @return void
|
||||
*/
|
||||
public function __construct( $httpCode, $select, $page, $activeRecordClass, $count )
|
||||
public function __construct( $httpCode, $select, $page, $activeRecordClass, $count, \IPS\Member $authorizedMember = NULL, $perPage=NULL )
|
||||
{
|
||||
$this->httpCode = $httpCode;
|
||||
$this->page = $page;
|
||||
$this->select = $select;
|
||||
$this->activeRecordClass = $activeRecordClass;
|
||||
$this->count = $count;
|
||||
$this->httpCode = $httpCode;
|
||||
$this->page = (int) $page;
|
||||
$this->select = $select;
|
||||
$this->activeRecordClass = $activeRecordClass;
|
||||
$this->count = $count;
|
||||
$this->resultsPerPage = $perPage ? (int) $perPage : 25;
|
||||
$this->authorizedMember = $authorizedMember;
|
||||
}
|
||||
|
||||
/**
|
||||
* Data to output
|
||||
*
|
||||
* @retrun string
|
||||
* @return string
|
||||
*/
|
||||
public function getOutput()
|
||||
{
|
||||
@@ -85,7 +94,7 @@ class _PaginatedResponse extends Response
|
||||
{
|
||||
foreach ( new \IPS\Patterns\ActiveRecordIterator( $this->select, $this->activeRecordClass ) as $result )
|
||||
{
|
||||
$results[] = $result->apiOutput();
|
||||
$results[] = $result->apiOutput( $this->authorizedMember );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user