Page::mapApiFieldMethods($list, $Field, $type)

Version 3.8

Manipulate the list of allowed api field methods

This function is run when page called via api.

Return value

Array $list

Arguments

$list
Array List of field methods
$Field
mad_sivutiedot_kentta Field
$type
String doc=Return all information, name=Return just name (for isCallableApi -check)

Full documentation

Add custom method to fields allowed methods:

function mapApiFieldMethods($list, $Field, $type='doc')
{
    if ( $Field->getName('customer') ){
    $list[] = Array(
        'name' => 'getCustomerName',
        'type' => 'String',
        'example' => 'Customer name',
        'description' => 'Return customer name',
        'arguments' => Array(
            Array(
                'name' => '',
                'type' => 'String'
                'default' => '',
                'description' => ''
            )
        ),
        'documentation' => true
    );        
    return $list;
}