XpressEngine Core  1.11.2
 All Classes Namespaces Files Functions Variables Pages
SelectColumnTag.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 
12 {
13 
19  var $alias;
20 
27 
34  function __construct($column)
35  {
36  if($column == "*" || $column->attrs->name == '*')
37  {
38  parent::__construct(NULL);
39  $this->name = "*";
40  }
41  else
42  {
43  parent::__construct($column->attrs->name);
44  $dbParser = DB::getParser();
45  $this->name = $dbParser->parseExpression($this->name);
46 
47  $this->alias = $column->attrs->alias;
48  $this->click_count = $column->attrs->click_count;
49  }
50  }
51 
65  {
66  if($this->name == '*')
67  {
68  return "new StarExpression()";
69  }
70  if($this->click_count)
71  {
72  return sprintf('new ClickCountExpression(\'%s\', %s, $args->%s)', $this->name, $this->alias ? '\'' . $this->alias . '\'' : "''", $this->click_count);
73  }
74  if(strpos($this->name, '$') === 0)
75  {
76  return sprintf('new SelectExpression($args->%s)', substr($this->name, 1));
77  }
78  $dbParser = DB::getParser();
79  return sprintf('new SelectExpression(\'%s\'%s)', $this->name, $this->alias ? ', \'' . $dbParser->escape($this->alias) . '\'' : '');
80  }
81 
82 }
83 /* End of file SelectColumnTag.class.php */
84 /* Location: ./classes/xml/xmlquery/tags/column/SelectColumnTag.class.php */
getParser($force=FALSE)
Definition: DB.class.php:1345