Esempio n. 1
0
 /**
  * 문서의 투표 수 정보 반환
  * 찬서(assent), 반대(dissent) 수 반환
  *
  * @param string $id document id
  * @return array
  */
 public function count($id)
 {
     $this->counter->init(self::COUNTER_NAME);
     $counts = ['assent' => 0, 'dissent' => 0];
     foreach ($this->counter->countsByOption($id) as $row) {
         $counts[$row['counterOption']] = $row['count'];
     }
     return $counts;
 }