Blesta Source Documentation

OrderAffiliatePaymentMethods extends OrderModel

Order Affiliate Payment Method Management

Table of Contents

Methods

add() Add an affiliate payment method
delete() Permanently deletes the given affiliate payment method
edit() Edit an affiliate payment method
get() Fetches the affiliate payment method with the given ID
getAll() Returns all affiliate payment methods in the system for the given company
getList() Returns a list of affiliate payment methods for the given company
getListCount() Returns the total number of payment methods for the given company
getAffiliatePaymentMethod() Returns a partial affiliate payment method query
getNames() Fetches all names created for the given payment method
getRules() Returns all validation rules for adding/editing affiliate payment methods
setNames() Sets the multilingual payment method names
Methods

add()

Add an affiliate payment method

public add(array<string|int, mixed> $vars) : int
Parameters
$vars : array<string|int, mixed>

An array of input data including:

  • company_id The ID of the company to which the payment method is assigned
  • names A list of name arrays each including:
    • lang The code of the language in which this name is written
    • name The name for this payment method and language
Return values
int

The ID of the affiliate payment method that was created, void on error

delete()

Permanently deletes the given affiliate payment method

public delete(int $payment_method_id) : mixed
Parameters
$payment_method_id : int

The ID of the affiliate payment method to delete

edit()

Edit an affiliate payment method

public edit(int $payment_method_id, array<string|int, mixed> $vars) : int
Parameters
$payment_method_id : int

The ID of the affiliate payment method to edit

$vars : array<string|int, mixed>

An array of input data including:

  • company_id The ID of the company to which the payment method is assigned
  • names A list of name arrays each including:
    • lang The code of the language in which this name is written
    • name The name for this payment method and language
Return values
int

The ID of the affiliate that was updated, void on error

get()

Fetches the affiliate payment method with the given ID

public get(int $payment_method_id) : mixed
Parameters
$payment_method_id : int

The ID of the payment method to fetch

Return values
mixed

A stdClass object representing the payment method, false if no such payment method exists

getAll()

Returns all affiliate payment methods in the system for the given company

public getAll(int $company_id[, array<string|int, mixed> $order = ['id' => 'desc'] ]) : array<string|int, mixed>
Parameters
$company_id : int

The ID of the company for which to fetch payment methods

$order : array<string|int, mixed> = ['id' => 'desc']

A key/value pair array of fields to order the results by

Return values
array<string|int, mixed>

An array of stdClass objects, each representing a payment method

getList()

Returns a list of affiliate payment methods for the given company

public getList(int $company_id[, int $page = 1 ][, array<string|int, mixed> $order = ['id' => 'desc'] ]) : array<string|int, mixed>
Parameters
$company_id : int

The ID of the company to fetch payment methods from

$page : int = 1

The page number of results to fetch

$order : array<string|int, mixed> = ['id' => 'desc']

A key/value pair array of fields to order the results by

Return values
array<string|int, mixed>

An array of stdClass objects, each representing a payment method

getListCount()

Returns the total number of payment methods for the given company

public getListCount(int $company_id) : int
Parameters
$company_id : int

The ID of the company to fetch payment method count from

Return values
int

The total number of affiliate payment methods for the given company

getAffiliatePaymentMethod()

Returns a partial affiliate payment method query

private getAffiliatePaymentMethod([array<string|int, mixed> $filters = [] ]) : Record
Parameters
$filters : array<string|int, mixed> = []

A list of filters for the query

Return values
Record

A partially built affiliate payment method query

getNames()

Fetches all names created for the given payment method

private getNames(int $payment_method_id) : array<string|int, mixed>
Parameters
$payment_method_id : int

The payment method ID to fetch names for

Return values
array<string|int, mixed>

An array of stdClass objects representing payment method names

getRules()

Returns all validation rules for adding/editing affiliate payment methods

private getRules(array<string|int, mixed> $vars[, bool $edit = false ]) : array<string|int, mixed>
Parameters
$vars : array<string|int, mixed>

An array of input key/value pairs

$edit : bool = false

True if this if an edit, false otherwise

Return values
array<string|int, mixed>

An array of validation rules

setNames()

Sets the multilingual payment method names

private setNames(int $payment_method_id, array<string|int, mixed> $names) : mixed
Parameters
$payment_method_id : int

The ID of the payment method to set the names for

$names : array<string|int, mixed>

An array including:

  • lang The language code (e.g. 'en_us')
  • name The name in the specified language
Tags
subpackage

plugins.order.models

copyright

Copyright (c) 2020, Phillips Data, Inc.

license

http://www.blesta.com/license/ The Blesta License Agreement

link

Blesta


        
On this page

Search results