Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
ActionUsage Class Reference

Verify arguments for action function. More...

+ Inheritance diagram for ActionUsage:
+ Collaboration diagram for ActionUsage:

Public Member Functions

 __construct (Action &$action)
 
 getUsage ()
 
- Public Member Functions inherited from ApiUsage
 __construct ()
 
 setText ($text)
 
 setDefinitionText ($text)
 
 addHidden ($argName, $argDefinition)
 
 addHiddenParameter ($argName, $argDefinition)
 
 addNeeded ($argName, $argDefinition, array $restriction=null)
 
 addRequiredParameter ($argName, $argDefinition, $restriction=null)
 
 addOption ($argName, $argDefinition, array $restriction=null, $default=null)
 
 addOptionalParameter ($argName, $argDefinition, $restriction=null, $default=null)
 
 addEmpty ($argName, $argDefinition="")
 
 addEmptyParameter ($argName, $argDefinition="")
 
 getUsage ()
 
 exitError ($error= '')
 
 strict ($strict=true)
 if false additionnal arguments are ignored, default is true More...
 
 setStrictMode ($strict=true)
 if false additionnal arguments are ignored, default is true More...
 
 verify ($useException=false)
 

Static Public Member Functions

static isFile ($argVal, $argName, $apiUsage)
 
- Static Public Member Functions inherited from ApiUsage
static isScalar ($argVal, $argName, $apiUsage)
 
static isArray ($argVal, $argName, $apiUsage)
 
static matchValues ($value, $restrictions)
 

Protected Member Functions

 getArgumentValue ($key, $defaultValue= '')
 
- Protected Member Functions inherited from ApiUsage
 getArgumentValue ($key, $defaultValue= '')
 
 isCallable ($f)
 
 getHiddenKeys ()
 

Additional Inherited Members

- Data Fields inherited from ApiUsage
const THROW_EXITHELP = 1988
 
const GET_USAGE = null
 
- Protected Attributes inherited from ApiUsage
 $action
 
 $strict = true
 
 $useException = false
 

Detailed Description

Verify arguments for action function.

Verify arguments for action function

$usage->setDescriptionText("Refresh documents ");
$usage->addRequiredParameter("famid", "the family filter");
$usage->addOptionalParameter("revision", "use all revision - default is no", array(
"yes",
"no"
));
$usage->addOptionalParameter("save", "use modify default is light", array(
"complete",
"light",
"none"
));
$usage->verify();

Definition at line 27 of file Class.ActionUsage.php.

Constructor & Destructor Documentation

__construct ( Action $action)

init current action

Parameters
Action&$actioncurrent action

Definition at line 34 of file Class.ActionUsage.php.

+ Here is the call graph for this function:

Member Function Documentation

getArgumentValue (   $key,
  $defaultValue = '' 
)
protected

Return value of argument key

Parameters
string$keythe identifier
string$defaultValuevalue to return if value is empty
Returns
mixed|string

Definition at line 64 of file Class.ActionUsage.php.

getUsage ( )
Api:
Get usage for action funtion
Returns
mixed|string

Definition at line 51 of file Class.ActionUsage.php.

static isFile (   $argVal,
  $argName,
  $apiUsage 
)
static

Restriction callback to verify a file array value

Parameters
string$argValargument value
string$argNameargument name
ApiUsage$apiUsagecurrent apiUsage object
Returns
string

Definition at line 82 of file Class.ActionUsage.php.


The documentation for this class was generated from the following file:
← centre documentaire © anakeen