* Factory 에 의해서 인스턴스 생성 * $name, $options 멤버 변수를 이용해서 등록, 조회, 삭제할 때 counter_logs 테이블의 counterName, counterOption 컬럼에 사용 * $name 에 따라 여러 유형의 Counter 인스턴스를 만들 수 있음 * $options 는 $name 에서 사용할 option 항목
Author: XE Developers (developers@xpressengine.com)
 /**
  * 반대
  *
  * @param ItemEntity            $item   board item entity
  * @param MemberEntityInterface $author user instance
  * @return void
  */
 public function remove(ItemEntity $item, MemberEntityInterface $author)
 {
     $doc = $item->getDocument();
     $this->init();
     $this->counter->remove($doc->id, $author, $option);
     $this->updateCount($doc);
 }
 /**
  * 반대
  *
  * @param ItemEntity            $item   board item entity
  * @param MemberEntityInterface $author user instance
  * @param string                $option 'assent' or 'dissent'
  * @return void
  */
 public function remove(ItemEntity $item, MemberEntityInterface $author, $option)
 {
     $doc = $item->getDocument();
     $this->counter->init(self::COUNTER_NAME, $option);
     $this->counter->remove($doc->id, $author, $option);
     $count = $this->count($doc->id);
     if ($option == 'assent') {
         $doc->assentCount = $count['assent'];
     } elseif ($option == 'dissent') {
         $doc->dissentCount = $count['dissent'];
     }
     $this->document->rawPut($doc);
 }
 /**
  * test get config handler
  *
  * @return void
  */
 public function testGetConfigHandler()
 {
     $repo = $this->repo;
     $session = $this->session;
     $configHandler = $this->configHandler;
     $member = $this->member;
     $auth = $this->auth;
     $request = $this->request;
     $counter = new Counter($repo, $session, $configHandler, $member, $auth, $request);
     $configHandler = $counter->getConfigHandler();
     $this->assertInstanceOf('Xpressengine\\Counter\\ConfigHandler', $configHandler);
 }
 /**
  * has vote
  *
  * @param Board         $board  board model
  * @param UserInterface $user   user
  * @param string        $option 'assent' or 'dissent'
  * @return bool
  */
 public function hasVote(Board $board, $user, $option)
 {
     return $this->voteCounter->has($board->id, $user, $option);
 }