public function addListCommands()
    {
        $story = $this->getController()->getItem();

        if ($story->authorize('vote')) {
            $this->getController()->setItem($story->object);
            $this->addCommand('vote');
            $this->getController()->setItem($story);
        }

        if ($story->authorize('add.comment')) {
            $this->getController()->setItem($story->object);

            $this->addCommand('comment')
                 ->getCommand('comment')
                 ->storyid($story->id);

            $this->getController()->setItem($story);
        }

        if ($story->numOfComments > 10) {
            $this->addCommand('view');
        }

        if ($story->authorize('delete')) {
            $this->addCommand('delete');
        }
    }
public function addListCommands()
    {
        $story = $this->getController()->getItem();

        if ($story->authorize('vote')) {
            $this->getController()->setItem($story->object);
            $this->addCommand('vote');
            $this->getController()->setItem($story);
        }

        if ($story->authorize('add.comment')) {
            $this->getController()->setItem($story->object);

            $this->addCommand('comment')
                 ->getCommand('comment')
                 ->storyid($story->id);

            $this->getController()->setItem($story);
        }

        if ($story->numOfComments > 10) {
            $this->addCommand('view');
        }

        if ($story->authorize('delete')) {
            $this->addCommand('delete');
        }
    }
public function addListCommands ( ) { $ story = $ this -> getController ( ) -> getItem ( ) ; if ( $ story -> authorize ( 'vote' ) ) { $ this -> getController ( ) -> setItem ( $ story -> object ) ; $ this -> addCommand ( 'vote' ) ; $ this -> getController ( ) -> setItem ( $ story ) ; } if ( $ story -> authorize ( 'add.comment' ) ) { $ this -> getController ( ) -> setItem ( $ story -> object ) ; $ this -> addCommand ( 'comment' ) -> getCommand ( 'comment' ) -> storyid ( $ story -> id ) ; $ this -> getController ( ) -> setItem ( $ story ) ; } if ( $ story -> numOfComments > 10 ) { $ this -> addCommand ( 'view' ) ; } if ( $ story -> authorize ( 'delete' ) ) { $ this -> addCommand ( 'delete' ) ; } }
Set the list commands.
Set the list commands .