Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
Zend_Server_Method_Definition Class Reference

Public Member Functions

 __construct ($options=null)
 
 setOptions (array $options)
 
 setName ($name)
 
 getName ()
 
 setCallback ($callback)
 
 getCallback ()
 
 addPrototype ($prototype)
 
 addPrototypes (array $prototypes)
 
 setPrototypes (array $prototypes)
 
 getPrototypes ()
 
 setMethodHelp ($methodHelp)
 
 getMethodHelp ()
 
 setObject ($object)
 
 getObject ()
 
 setInvokeArguments (array $invokeArguments)
 
 getInvokeArguments ()
 
 toArray ()
 

Protected Attributes

 $_callback
 
 $_invokeArguments = array()
 
 $_methodHelp = ''
 
 $_name
 
 $_object
 
 $_prototypes = array()
 

Detailed Description

Definition at line 32 of file Definition.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $options = null)

Constructor

Parameters
null | array$options
Returns
void

Definition at line 70 of file Definition.php.

71  {
72  if ((null !== $options) && is_array($options)) {
73  $this->setOptions($options);
74  }
75  }
setOptions(array $options)
Definition: Definition.php:83

Member Function Documentation

◆ addPrototype()

addPrototype (   $prototype)

Add prototype to method definition

Parameters
array | Zend_Server_Method_Prototype$prototype
Returns
Zend_Server_Method_Definition

Definition at line 151 of file Definition.php.

152  {
153  if (is_array($prototype)) {
154  #require_once 'Zend/Server/Method/Prototype.php';
155  $prototype = new Zend_Server_Method_Prototype($prototype);
156  } elseif (!$prototype instanceof Zend_Server_Method_Prototype) {
157  #require_once 'Zend/Server/Exception.php';
158  throw new Zend_Server_Exception('Invalid method prototype provided');
159  }
160  $this->_prototypes[] = $prototype;
161  return $this;
162  }
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17

◆ addPrototypes()

addPrototypes ( array  $prototypes)

Add multiple prototypes at once

Parameters
array$prototypesArray of Zend_Server_Method_Prototype objects or arrays
Returns
Zend_Server_Method_Definition

Definition at line 170 of file Definition.php.

171  {
172  foreach ($prototypes as $prototype) {
173  $this->addPrototype($prototype);
174  }
175  return $this;
176  }

◆ getCallback()

getCallback ( )

Get method callback

Returns
Zend_Server_Method_Callback

Definition at line 140 of file Definition.php.

141  {
142  return $this->_callback;
143  }

◆ getInvokeArguments()

getInvokeArguments ( )

Retrieve invoke arguments

Returns
array

Definition at line 266 of file Definition.php.

267  {
269  }

◆ getMethodHelp()

getMethodHelp ( )

Get method help

Returns
string

Definition at line 218 of file Definition.php.

219  {
220  return $this->_methodHelp;
221  }

◆ getName()

getName ( )

Get method name

Returns
string

Definition at line 111 of file Definition.php.

112  {
113  return $this->_name;
114  }

◆ getObject()

getObject ( )

Get object to use with method calls

Returns
null|object

Definition at line 244 of file Definition.php.

245  {
246  return $this->_object;
247  }

◆ getPrototypes()

getPrototypes ( )

Get all prototypes

Returns
array $prototypes Array of Zend_Server_Method_Prototype objects or arrays

Definition at line 196 of file Definition.php.

197  {
198  return $this->_prototypes;
199  }

◆ setCallback()

setCallback (   $callback)

Set method callback

Parameters
array | Zend_Server_Method_Callback$callback
Returns
Zend_Server_Method_Definition

Definition at line 122 of file Definition.php.

123  {
124  if (is_array($callback)) {
125  #require_once 'Zend/Server/Method/Callback.php';
126  $callback = new Zend_Server_Method_Callback($callback);
127  } elseif (!$callback instanceof Zend_Server_Method_Callback) {
128  #require_once 'Zend/Server/Exception.php';
129  throw new Zend_Server_Exception('Invalid method callback provided');
130  }
131  $this->_callback = $callback;
132  return $this;
133  }
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17

◆ setInvokeArguments()

setInvokeArguments ( array  $invokeArguments)

Set invoke arguments

Parameters
array$invokeArguments
Returns
Zend_Server_Method_Definition

Definition at line 255 of file Definition.php.

256  {
257  $this->_invokeArguments = $invokeArguments;
258  return $this;
259  }

◆ setMethodHelp()

setMethodHelp (   $methodHelp)

Set method help

Parameters
string$methodHelp
Returns
Zend_Server_Method_Definition

Definition at line 207 of file Definition.php.

208  {
209  $this->_methodHelp = (string) $methodHelp;
210  return $this;
211  }

◆ setName()

setName (   $name)

Set method name

Parameters
string$name
Returns
Zend_Server_Method_Definition

Definition at line 100 of file Definition.php.

101  {
102  $this->_name = (string) $name;
103  return $this;
104  }
if(!isset($_GET['name'])) $name
Definition: log.php:14

◆ setObject()

setObject (   $object)

Set object to use with method calls

Parameters
object$object
Returns
Zend_Server_Method_Definition

Definition at line 229 of file Definition.php.

230  {
231  if (!is_object($object) && (null !== $object)) {
232  #require_once 'Zend/Server/Exception.php';
233  throw new Zend_Server_Exception('Invalid object passed to ' . __CLASS__ . '::' . __METHOD__);
234  }
235  $this->_object = $object;
236  return $this;
237  }

◆ setOptions()

setOptions ( array  $options)

Set object state from options

Parameters
array$options
Returns
Zend_Server_Method_Definition

Definition at line 83 of file Definition.php.

84  {
85  foreach ($options as $key => $value) {
86  $method = 'set' . ucfirst($key);
87  if (method_exists($this, $method)) {
88  $this->$method($value);
89  }
90  }
91  return $this;
92  }
$value
Definition: gender.phtml:16
$method
Definition: info.phtml:13

◆ setPrototypes()

setPrototypes ( array  $prototypes)

Set all prototypes at once (overwrites)

Parameters
array$prototypesArray of Zend_Server_Method_Prototype objects or arrays
Returns
Zend_Server_Method_Definition

Definition at line 184 of file Definition.php.

185  {
186  $this->_prototypes = array();
187  $this->addPrototypes($prototypes);
188  return $this;
189  }
addPrototypes(array $prototypes)
Definition: Definition.php:170

◆ toArray()

toArray ( )

Serialize to array

Returns
array

Definition at line 276 of file Definition.php.

277  {
278  $prototypes = $this->getPrototypes();
279  $signatures = array();
280  foreach ($prototypes as $prototype) {
281  $signatures[] = $prototype->toArray();
282  }
283 
284  return array(
285  'name' => $this->getName(),
286  'callback' => $this->getCallback()->toArray(),
287  'prototypes' => $signatures,
288  'methodHelp' => $this->getMethodHelp(),
289  'invokeArguments' => $this->getInvokeArguments(),
290  'object' => $this->getObject(),
291  );
292  }

Field Documentation

◆ $_callback

$_callback
protected

Definition at line 37 of file Definition.php.

◆ $_invokeArguments

$_invokeArguments = array()
protected

Definition at line 42 of file Definition.php.

◆ $_methodHelp

$_methodHelp = ''
protected

Definition at line 47 of file Definition.php.

◆ $_name

$_name
protected

Definition at line 52 of file Definition.php.

◆ $_object

$_object
protected

Definition at line 57 of file Definition.php.

◆ $_prototypes

$_prototypes = array()
protected

Definition at line 62 of file Definition.php.


The documentation for this class was generated from the following file: