Remove unnecessary use of BaseObject

- 트리거 등 반환값이 필요하지 않은 곳에서 new BaseObject()를 반환하는 것 삭제
- 모듈 설치, 업데이트 후 무의미한 new BaseObject()를 반환하는 것 삭제
- 사용자에게 에러 메시지를 돌려주는 용도로 new BaseObject(-1, '에러메시지')를
  사용하는 경우는 대부분 $this->setError()로 변경함. 언어 변환과 sprintf()
  처리까지 한 번에 이루어지므로 이쪽이 더 편리함.
This commit is contained in:
Kijin Sung 2017-12-01 00:54:51 +09:00
parent 03d74a984f
commit 84e5542d77
103 changed files with 692 additions and 862 deletions

View file

@ -23,13 +23,13 @@ class pollModel extends poll
$args->poll_srl = intval($poll_srl);
$logged_info = Context::get('logged_info');
if(!$args->poll_srl || $args->poll_srl === 0) return new BaseObject(-1,"poll_no_poll_srl");
if(!$args->poll_srl || $args->poll_srl === 0) return $this->setError("poll_no_poll_srl");
// Get the information related to the survey
$columnList = array('poll_count', 'stop_date','poll_type','member_srl');
$output = executeQuery('poll.getPoll', $args, $columnList);
$poll_member_srl = $output->data->member_srl;
if(!$output->data) return new BaseObject(-1,"poll_no_poll_or_deleted_poll");
if(!$output->data) return $this->setError("poll_no_poll_or_deleted_poll");
$poll = new stdClass;
@ -96,7 +96,7 @@ class pollModel extends poll
$poll_srl = Context::get('poll_srl');
$poll_item = Context::get('poll_item');
if(!$poll_srl || $poll_srl=='') return new BaseObject(-1,"poll_no_poll_srl");
if(!$poll_srl || $poll_srl=='') return $this->setError("poll_no_poll_srl");
$args->poll_srl = $poll_srl;
$args->poll_item_srl = $poll_item;
@ -104,7 +104,7 @@ class pollModel extends poll
// Get the information related to the survey
$columnList = array('poll_type');
$output = executeQuery('poll.getPoll', $args, $columnList);
if(!$output->data) return new BaseObject(-1,"poll_no_poll_or_deleted_poll");
if(!$output->data) return $this->setError("poll_no_poll_or_deleted_poll");
$type = $output->data->poll_type;
$poll = new stdClass();
@ -176,7 +176,7 @@ class pollModel extends poll
public function getPollstatus()
{
$poll_srl = Context::get('poll_srl');
if(!$poll_srl || $poll_srl=='') return new BaseObject(-1,"poll_no_poll_srl");
if(!$poll_srl || $poll_srl=='') return $this->setError("poll_no_poll_srl");
if($this->isPolled($poll_srl)) $is_polled = 1;
else $is_polled = 0;