PHP 클래스 Mollie_API_Resource_Base, mollie-api-php

All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
저자: Mollie B.V. ([email protected])
파일 보기 프로젝트 열기: mollie/mollie-api-php 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$api Mollie_API_Client
$parent_id string | null
$resource_path string

공개 메소드들

메소드 설명
__construct ( Mollie_API_Client $api )
all ( integer $offset, integer $limit, array $filters = [] ) : Mollie_API_Object_List Retrieve all objects of a certain resource.
create ( array $data = [], array $filters = [] ) : object Create a resource with the remote API.
delete ( string $resource_id ) : object Delete a single resource from Mollie.
get ( string $resource_id, array $filters = [] ) : object Retrieve information on a single resource from Mollie.
getResourcePath ( ) : string
setResourcePath ( string $resource_path )
with ( Mollie_API_Object_Payment | object $parent ) Set the resource to use a certain parent. Use this method before performing a get() or all() call.
withParentId ( string $parent_id )

보호된 메소드들

메소드 설명
copy ( object $api_result, object $object ) : object Copy the results received from the API into the PHP objects that we use.
getResourceObject ( ) : object Get the object that is used by this API. Every API uses one type of object.
performApiCall ( $http_method, $api_method, null $http_body = NULL ) : object Perform an API call, and interpret the results and convert them to correct objects.
rest_update ( string $rest_resource, string $id, string $body ) : object Sends a POST request to a single Molle API object to update it.

비공개 메소드들

메소드 설명
buildQueryString ( array $filters ) : string
rest_create ( string $rest_resource, $body, array $filters ) : object
rest_delete ( string $rest_resource, string $id ) : object Sends a DELETE request to a single Molle API object.
rest_list ( $rest_resource, integer $offset, integer $limit = self::DEFAULT_LIMIT, array $filters ) : Mollie_API_Object_List Get a collection of objects from the REST API.
rest_read ( string $rest_resource, string $id, array $filters ) : object Retrieves a single object from the REST API.

메소드 상세

__construct() 공개 메소드

public __construct ( Mollie_API_Client $api )
$api Mollie_API_Client

all() 공개 메소드

Retrieve all objects of a certain resource.
public all ( integer $offset, integer $limit, array $filters = [] ) : Mollie_API_Object_List
$offset integer
$limit integer
$filters array
리턴 Mollie_API_Object_List

copy() 보호된 메소드

Copy the results received from the API into the PHP objects that we use.
protected copy ( object $api_result, object $object ) : object
$api_result object
$object object
리턴 object

create() 공개 메소드

Create a resource with the remote API.
public create ( array $data = [], array $filters = [] ) : object
$data array An array containing details on the resource. Fields supported depend on the resource created.
$filters array
리턴 object

delete() 공개 메소드

Will throw a Mollie_API_Exception if the resource cannot be found.
public delete ( string $resource_id ) : object
$resource_id string
리턴 object

get() 공개 메소드

Will throw a Mollie_API_Exception if the resource cannot be found.
public get ( string $resource_id, array $filters = [] ) : object
$resource_id string
$filters array
리턴 object

getResourceObject() 추상적인 보호된 메소드

Get the object that is used by this API. Every API uses one type of object.
abstract protected getResourceObject ( ) : object
리턴 object

getResourcePath() 공개 메소드

public getResourcePath ( ) : string
리턴 string

performApiCall() 보호된 메소드

Perform an API call, and interpret the results and convert them to correct objects.
protected performApiCall ( $http_method, $api_method, null $http_body = NULL ) : object
$http_method
$api_method
$http_body null
리턴 object

rest_update() 보호된 메소드

Sends a POST request to a single Molle API object to update it.
protected rest_update ( string $rest_resource, string $id, string $body ) : object
$rest_resource string
$id string
$body string
리턴 object

setResourcePath() 공개 메소드

public setResourcePath ( string $resource_path )
$resource_path string

with() 공개 메소드

Set the resource to use a certain parent. Use this method before performing a get() or all() call.
public with ( Mollie_API_Object_Payment | object $parent )
$parent Mollie_API_Object_Payment | object An object with an 'id' property

withParentId() 공개 메소드

public withParentId ( string $parent_id )
$parent_id string

프로퍼티 상세

$api 보호되어 있는 프로퍼티

protected Mollie_API_Client $api
리턴 Mollie_API_Client

$parent_id 보호되어 있는 프로퍼티

protected string|null $parent_id
리턴 string | null

$resource_path 보호되어 있는 프로퍼티

protected string $resource_path
리턴 string