XpressEngine Core  1.11.2
 All Classes Namespaces Files Functions Variables Pages
poll.admin.model.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) NAVER <http://www.navercorp.com> */
8 class pollAdminModel extends poll
9 {
13  function init()
14  {
15  }
16 
20  function getPollList($args)
21  {
22  $output = executeQueryArray('poll.getPollList', $args);
23  if(!$output->toBool()) return $output;
24 
25  //if($output->data && !is_array($output->data)) $output->data = array($output->data);
26  return $output;
27  }
28 
33  {
34  $output = executeQueryArray('poll.getPollListWithMember', $args);
35  if(!$output->toBool()) return $output;
36 
37  return $output;
38  }
39 
43  function getPollAdminTarget()
44  {
45  $poll_srl = Context::get('poll_srl');
46  $upload_target_srl = Context::get('upload_target_srl');
47 
48  $oDocumentModel = getModel('document');
49  $oCommentModel = getModel('comment');
50 
51  $oDocument = $oDocumentModel->getDocument($upload_target_srl);
52 
53  if(!$oDocument->isExists()) $oComment = $oCommentModel->getComment($upload_target_srl);
54 
55  if($oComment && $oComment->isExists())
56  {
57  $this->add('document_srl', $oComment->get('document_srl'));
58  $this->add('comment_srl', $oComment->get('comment_srl'));
59  }
60  elseif($oDocument->isExists())
61  {
62  $this->add('document_srl', $oDocument->get('document_srl'));
63  }
64  else return new BaseObject(-1, 'msg_not_founded');
65  }
66 }
67 /* End of file poll.admin.model.php */
68 /* Location: ./modules/poll/poll.admin.model.php */
getPollListWithMember($args)
Get the list of polls with member info.
getPollList($args)
Get the list of polls.
$output
Definition: ko.install.php:193
add($key, $val)
init()
Initialization.
getPollAdminTarget()
Get the original poll.
$args
Definition: ko.install.php:185
$oDocumentModel
Definition: ko.install.php:259
getModel($module_name)
Definition: func.inc.php:145
executeQueryArray($query_id, $args=NULL, $arg_columns=NULL)
Definition: func.inc.php:219
The parent class of the poll module.
Definition: poll.class.php:8
The admin model class of the poll module.