XpressEngine Core  1.11.2
 All Classes Namespaces Files Functions Variables Pages
ConditionGroupTag.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 
12 {
13 
19 
24  var $pipe;
25 
32  function __construct($conditions, $pipe = "")
33  {
34  $this->pipe = $pipe;
35 
36  if(!is_array($conditions))
37  {
38  $conditions = array($conditions);
39  }
40 
41  foreach($conditions as $condition)
42  {
43  //if($condition->node_name === 'query') $this->conditions[] = new QueryTag($condition, true);
44  $this->conditions[] = new ConditionTag($condition);
45  }
46  }
47 
48  function getConditions()
49  {
50  return $this->conditions;
51  }
52 
58  {
59  $conditions_string = 'array(' . PHP_EOL;
60  foreach($this->conditions as $condition)
61  {
62  $conditions_string .= $condition->getConditionString() . PHP_EOL . ',';
63  }
64  $conditions_string = substr($conditions_string, 0, -2); //remove ','
65  $conditions_string .= ')';
66 
67  return sprintf("new ConditionGroup(%s%s)", $conditions_string, $this->pipe ? ',\'' . $this->pipe . '\'' : '');
68  }
69 
70  function getArguments()
71  {
72  $arguments = array();
73  foreach($this->conditions as $condition)
74  {
75  $arguments = array_merge($arguments, $condition->getArguments());
76  }
77  return $arguments;
78  }
79 
80 }
81 /* End of file ConditionGroupTag.class.php */
82 /* Location: ./classes/xml/xmlquery/tags/condition/ConditionGroupTag.class.php */
__construct($conditions, $pipe="")