PEEL Shopping
Open source ecommerce : PEEL Shopping
Function.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of Twig.
5  *
6  * (c) 2010 Fabien Potencier
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11 
21 {
22  protected $options;
23  protected $arguments = array();
24 
25  public function __construct(array $options = array())
26  {
27  $this->options = array_merge(array(
28  'needs_environment' => false,
29  'needs_context' => false,
30  'callable' => null,
31  ), $options);
32  }
33 
34  public function setArguments($arguments)
35  {
36  $this->arguments = $arguments;
37  }
38 
39  public function getArguments()
40  {
41  return $this->arguments;
42  }
43 
44  public function needsEnvironment()
45  {
46  return $this->options['needs_environment'];
47  }
48 
49  public function needsContext()
50  {
51  return $this->options['needs_context'];
52  }
53 
54  public function getSafe(Twig_Node $functionArgs)
55  {
56  if (isset($this->options['is_safe'])) {
57  return $this->options['is_safe'];
58  }
59 
60  if (isset($this->options['is_safe_callback'])) {
61  return call_user_func($this->options['is_safe_callback'], $functionArgs);
62  }
63 
64  return array();
65  }
66 
67  public function getCallable()
68  {
69  return $this->options['callable'];
70  }
71 }
Represents a template function.
Definition: Function.php:20
Represents a template function.
needsEnvironment()
Definition: Function.php:44
Represents a node in the AST.
Definition: Node.php:18
getSafe(Twig_Node $functionArgs)
Definition: Function.php:54
setArguments($arguments)
Definition: Function.php:34
__construct(array $options=array())
Definition: Function.php:25
Represents a callable template function.

This documentation for Open ecommerce PEEL Shopping and PEEL.fr has been generated by Doxygen on Thu Oct 15 2015 14:41:18 - Peel ecommerce is a product of Agence web Advisto SAS. All rights reserved.