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

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

        // get workflows from dependencies
        /** @var SalesDependencyClassInterface $dependency */
        foreach ($this->dependencyClasses as $dependency) {
            $workflows = array_merge($workflows, $dependency->getWorkflows($order));
        }

        return array_values($workflows);
    }
public function getWorkflows($order)
    {
        $workflows = array(
            'confirm' => array(
                'section' => $this->getName(),
                'title' => 'salesorder.orders.confirm',
                'event' => 'sulu.salesorder.order.confirm.clicked',
                'disabled' => true,
            ),
            'edit' => array(
                'section' => $this->getName(),
                'title' => 'salesorder.orders.edit',
                'event' => 'sulu.salesorder.order.edit.clicked',
                'disabled' => true,
            ),
        );

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

        // get workflows from dependencies
        /** @var SalesDependencyClassInterface $dependency */
        foreach ($this->dependencyClasses as $dependency) {
            $workflows = array_merge($workflows, $dependency->getWorkflows($order));
        }

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

@param Order $order

@return array
Returns all possible workflows for the current entity .