* protected $obligatoryArguments = array( * '*' => array( // Obligatory arguments for all functions are * 'return' => array(), // 'return' with array() by default and * 'references' => array() // 'references' with array() by default * ), * 'result' => array( // There is an additional argument for the result function * 'errorCode' => 0 // This is 'error_code' with 0 by default * ) * ); * */ protected $obligatoryArguments = array(); /** * Reserved function's names * * Defines reserved(system) function's names described in the Mibew API. * @var array */ public $reservedFunctionNames = array(); /** * Returns obligatory arguments for the $function_name function * * @param string $function_name Function name * @return array An array of obligatory arguments */ public function getObligatoryArguments($function_name) { $obligatory_arguments = array(); // Add obligatory for all functions arguments if (! empty($this->obligatoryArguments['*'])) { $obligatory_arguments = array_merge( $obligatory_arguments, array_keys($this->obligatoryArguments['*']) ); } // Add obligatory arguments for given function if (! empty($this->obligatoryArguments[$function_name])) { $obligatory_arguments = array_merge( $obligatory_arguments, array_keys($this->obligatoryArguments[$function_name]) ); } return array_unique($obligatory_arguments); } /** * Returns default values of obligatory arguments for the $function_name function * * @param string $function_name Function name * @return array Associative array with keys are obligatory arguments and values are default * values of them */ public function getObligatoryArgumentsDefaults($function_name) { $obligatory_arguments = array(); // Add obligatory for all functions arguments if (! empty($this->obligatoryArguments['*'])) { $obligatory_arguments = array_merge($obligatory_arguments, $this->obligatoryArguments['*']); } // Add obligatory arguments for given function if (! empty($this->obligatoryArguments[$function_name])) { $obligatory_arguments = array_merge($obligatory_arguments, $this->obligatoryArguments[$function_name]); } return $obligatory_arguments; } } ?>