Programming Language PHP

Namespace Oro\Bundle\WorkflowBundle\Entity

Class WorkflowDefinition

Method/Function setRestrictions

Total Examples 1

1 code examples of PHP Oro\Bundle\WorkflowBundle\Entity\WorkflowDefinition::setRestrictions extracted from open source projects

Was this example useful?
0
                                                    private function setEntityRestrictions(WorkflowDefinition $workflowDefinition, Workflow $workflow)
    {
        $restrictions = $workflow->getRestrictions();
        $workflowRestrictions = [];
        foreach ($restrictions as $restriction) {
            $workflowRestriction = new WorkflowRestriction();
            $workflowRestriction
                ->setField($restriction->getField())
                ->setAttribute($restriction->getAttribute())
                ->setEntityClass($restriction->getEntity())
                ->setMode($restriction->getMode())
                ->setValues($restriction->getValues())
                ->setStep($workflowDefinition->getStepByName($restriction->getStep()));

            $workflowRestrictions[] = $workflowRestriction;
        }
        $workflowDefinition->setRestrictions($workflowRestrictions);
    }