PEEL Shopping
Open source ecommerce : PEEL Shopping
Defined.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of Twig.
5  *
6  * (c) 2011 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 
25 {
26  public function __construct(Twig_NodeInterface $node, $name, Twig_NodeInterface $arguments = null, $lineno)
27  {
28  parent::__construct($node, $name, $arguments, $lineno);
29 
30  if ($node instanceof Twig_Node_Expression_Name) {
31  $node->setAttribute('is_defined_test', true);
32  } elseif ($node instanceof Twig_Node_Expression_GetAttr) {
33  $node->setAttribute('is_defined_test', true);
34 
35  $this->changeIgnoreStrictCheck($node);
36  } else {
37  throw new Twig_Error_Syntax('The "defined" test only works with simple variables', $this->getLine());
38  }
39  }
40 
42  {
43  $node->setAttribute('ignore_strict_check', true);
44 
45  if ($node->getNode('node') instanceof Twig_Node_Expression_GetAttr) {
46  $this->changeIgnoreStrictCheck($node->getNode('node'));
47  }
48  }
49 
50  public function compile(Twig_Compiler $compiler)
51  {
52  $compiler->subcompile($this->getNode('node'));
53  }
54 }
getLine()
Definition: Node.php:109
Compiles a node to PHP code.
Definition: Compiler.php:18
Exception thrown when a syntax error occurs during lexing or parsing of a template.
Definition: Syntax.php:18
compile(Twig_Compiler $compiler)
Compiles the node to PHP.
Definition: Defined.php:50
$lineno
Definition: Node.php:22
if(strlen($date2)== '10') if($type== 'users-by-age'&&a_priv('admin_users', true)) elseif($type== 'forums-count'&&a_priv('admin_content', true)) elseif($type== 'forums-categories'&&a_priv('admin_content', true)) elseif($type== 'users-count'&&a_priv('admin_users', true)) elseif($type== 'product-categories'&&a_priv('admin_products', true)) elseif($type== 'users-by-sex'&&a_priv('admin_users', true)) elseif($type== 'users-by-country'&&a_priv('admin_users', true)) elseif($type== 'sales'&&a_priv('admin_sales', true))
Definition: chart-data.php:160
setAttribute($name, $value)
Sets an attribute.
Definition: Node.php:153
__construct(Twig_NodeInterface $node, $name, Twig_NodeInterface $arguments=null, $lineno)
Definition: Defined.php:26
subcompile(Twig_NodeInterface $node, $raw=true)
Definition: Compiler.php:91
Checks if a variable is defined in the current context.
Definition: Defined.php:24
Represents a node in the AST.
changeIgnoreStrictCheck(Twig_Node_Expression_GetAttr $node)
Definition: Defined.php:41
getNode($name)
Gets a node by name.
Definition: Node.php:187

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.