protected function _commandVote($command)
    {
        $entity = $this->getController()->getItem();
        $voted = $entity->votedUp(get_viewer());

        $action = $voted ? 'unvote' : 'vote';
        $class = 'action-'.$action;

        if (is($entity, 'ComBaseDomainEntityComment')) {
            $action .= 'comment';
            $class .= 'comment';
        }

        $label = $voted ? AnTranslator::_('LIB-AN-ACTION-UNVOTE') : AnTranslator::_('LIB-AN-ACTION-VOTE');

        $command
        ->setName($action)
        ->append(array('label' => $label))
        ->href(route($entity->getURL()))
        ->class($class)
        ->setAttribute('data-action', $action)
        ->setAttribute('data-nodeid', $entity->id);
    }
protected function _commandVote($command)
    {
        $entity = $this->getController()->getItem();
        $voted = $entity->votedUp(get_viewer());

        $action = $voted ? 'unvote' : 'vote';
        $class = 'action-'.$action;

        if (is($entity, 'ComBaseDomainEntityComment')) {
            $action .= 'comment';
            $class .= 'comment';
        }

        $label = $voted ? AnTranslator::_('LIB-AN-ACTION-UNVOTE') : AnTranslator::_('LIB-AN-ACTION-VOTE');

        $command
        ->setName($action)
        ->append(array('label' => $label))
        ->href(route($entity->getURL()))
        ->class($class)
        ->setAttribute('data-action', $action)
        ->setAttribute('data-nodeid', $entity->id);
    }
protected function _commandVote ( $ command ) { $ entity = $ this -> getController ( ) -> getItem ( ) ; $ voted = $ entity -> votedUp ( get_viewer ( ) ) ; $ action = $ voted ? 'unvote' : 'vote' ; $ class = 'action-' . $ action ; if ( is ( $ entity , 'ComBaseDomainEntityComment' ) ) { $ action .= 'comment' ; $ class .= 'comment' ; } $ label = $ voted ? AnTranslator :: _ ( 'LIB-AN-ACTION-UNVOTE' ) : AnTranslator :: _ ( 'LIB-AN-ACTION-VOTE' ) ; $ command -> setName ( $ action ) -> append ( array ( 'label' => $ label ) ) -> href ( route ( $ entity -> getURL ( ) ) ) -> class ( $ class ) -> setAttribute ( 'data-action' , $ action ) -> setAttribute ( 'data-nodeid' , $ entity -> id ) ; }
Vote Command for an entity.

@param LibBaseTemplateObject $command The action object
Vote Command for an entity .