MangoPay/ApiReports.php
public function Create($reportRequest, $idempotencyKey = null)
    {
        $type = $reportRequest->ReportType;

        if (is_null($type) || strlen($type) == 0)
            throw new Libraries\Exception('Report type property is required when create a report request.');

        switch ($type) {
            case ReportType::Transactions:
                return $this->CreateObject('reports_transactions_create', $reportRequest, '\MangoPay\ReportRequest', $type, null, $idempotencyKey);
            case ReportType::Wallets:
                return $this->CreateObject('reports_wallets_create', $reportRequest, '\MangoPay\ReportRequest', $type, null, $idempotencyKey);
            default:
                throw new Libraries\Exception('Unexpected Report type. Wrong ReportType value.');
        }
    }
public function Create($reportRequest, $idempotencyKey = null)
    {
        $type = $reportRequest->ReportType;

        if (is_null($type) || strlen($type) == 0)
            throw new Libraries\Exception('Report type property is required when create a report request.');

        switch ($type) {
            case ReportType::Transactions:
                return $this->CreateObject('reports_transactions_create', $reportRequest, '\MangoPay\ReportRequest', $type, null, $idempotencyKey);
            case ReportType::Wallets:
                return $this->CreateObject('reports_wallets_create', $reportRequest, '\MangoPay\ReportRequest', $type, null, $idempotencyKey);
            default:
                throw new Libraries\Exception('Unexpected Report type. Wrong ReportType value.');
        }
    }
public function Create ( $ reportRequest , $ idempotencyKey = null ) { $ type = $ reportRequest -> ReportType ; if ( is_null ( $ type ) || strlen ( $ type ) == 0 ) throw new Libraries \ Exception ( 'Report type property is required when create a report request.' ) ; switch ( $ type ) { case ReportType :: Transactions : return $ this -> CreateObject ( 'reports_transactions_create' , $ reportRequest , '\MangoPay\ReportRequest' , $ type , null , $ idempotencyKey ) ; case ReportType :: Wallets : return $ this -> CreateObject ( 'reports_wallets_create' , $ reportRequest , '\MangoPay\ReportRequest' , $ type , null , $ idempotencyKey ) ; default : throw new Libraries \ Exception ( 'Unexpected Report type. Wrong ReportType value.' ) ; } }
Creates new report request
@param \MangoPay\ReportRequest $reportRequest
@return \MangoPay\ReportRequest Report request instance returned from API
Creates new report request