public function getWorkflows($order)
    {
        $workflows = array();
        $actions = array(
            'confirm' => array(
                'section' => $this->getName(),
                'title' => 'salesorder.orders.confirm',
                'event' => 'sulu.salesorder.order.confirm.clicked'
            ),
            'edit' => array(
                'section' => $this->getName(),
                'title' => 'salesorder.orders.edit',
                'event' => 'sulu.salesorder.order.edit.clicked'
            ),
            'delete' => array(
                'section' => $this->getName(),
                'title' => 'salesorder.orders.delete',
                'event' => 'sulu.salesorder.order.delete',
                'parameters'=> array('id'=> $order->getId())
            ),
        );

        // define workflows by order's status
        $orderStatusId = $order->getStatus()->getId();
        // order is in created state
        if ($orderStatusId === OrderStatus::STATUS_CREATED) {
            $workflows[] = $actions['confirm'];
        }
        // order is confirmed
        else if ($orderStatusId === OrderStatus::STATUS_CONFIRMED) {
            $workflows[] = $actions['edit'];
        }

        // order is allowed to be deleted
        if ($this->allowDelete($order)) {
            $workflows[] = $actions['delete'];
        }

        // get workflows from dependencies
        /** @var SalesDependencyClassInterface $dependency */
        foreach ($this->dependencyClasses as $dependency) {
            $workflows = array_merge($workflows, $dependency->getWorkflows($order));
        }
        return $workflows;
    }
public function getWorkflows($order)
    {
        $workflows = array();
        $actions = array(
            'confirm' => array(
                'section' => $this->getName(),
                'title' => 'salesorder.orders.confirm',
                'event' => 'sulu.salesorder.order.confirm.clicked'
            ),
            'edit' => array(
                'section' => $this->getName(),
                'title' => 'salesorder.orders.edit',
                'event' => 'sulu.salesorder.order.edit.clicked'
            ),
            'delete' => array(
                'section' => $this->getName(),
                'title' => 'salesorder.orders.delete',
                'event' => 'sulu.salesorder.order.delete',
                'parameters'=> array('id'=> $order->getId())
            ),
        );

        // define workflows by order's status
        $orderStatusId = $order->getStatus()->getId();
        // order is in created state
        if ($orderStatusId === OrderStatus::STATUS_CREATED) {
            $workflows[] = $actions['confirm'];
        }
        // order is confirmed
        else if ($orderStatusId === OrderStatus::STATUS_CONFIRMED) {
            $workflows[] = $actions['edit'];
        }

        // order is allowed to be deleted
        if ($this->allowDelete($order)) {
            $workflows[] = $actions['delete'];
        }

        // get workflows from dependencies
        /** @var SalesDependencyClassInterface $dependency */
        foreach ($this->dependencyClasses as $dependency) {
            $workflows = array_merge($workflows, $dependency->getWorkflows($order));
        }
        return $workflows;
    }
public function getWorkflows ( $ order ) { $ workflows = array ( ) ; $ actions = array ( 'confirm' => array ( 'section' => $ this -> getName ( ) , 'title' => 'salesorder.orders.confirm' , 'event' => 'sulu.salesorder.order.confirm.clicked' ) , 'edit' => array ( 'section' => $ this -> getName ( ) , 'title' => 'salesorder.orders.edit' , 'event' => 'sulu.salesorder.order.edit.clicked' ) , 'delete' => array ( 'section' => $ this -> getName ( ) , 'title' => 'salesorder.orders.delete' , 'event' => 'sulu.salesorder.order.delete' , 'parameters' => array ( 'id' => $ order -> getId ( ) ) ) , ) ; // define workflows by order's status $ orderStatusId = $ order -> getStatus ( ) -> getId ( ) ; // order is in created state if ( $ orderStatusId === OrderStatus :: STATUS_CREATED ) { $ workflows [ ] = $ actions [ 'confirm' ] ; } // order is confirmed else if ( $ orderStatusId === OrderStatus :: STATUS_CONFIRMED ) { $ workflows [ ] = $ actions [ 'edit' ] ; } // order is allowed to be deleted if ( $ this -> allowDelete ( $ order ) ) { $ workflows [ ] = $ actions [ 'delete' ] ; } // get workflows from dependencies /** @var SalesDependencyClassInterface $dependency */ foreach ( $ this -> dependencyClasses as $ dependency ) { $ workflows = array_merge ( $ workflows , $ dependency -> getWorkflows ( $ order ) ) ; } return $ workflows ; }
returns all possible workflows for the current entity

@param Order $order
@return array
returns all possible workflows for the current entity