private function getDutyCount(array &$tree, array &$duty_count, \Symforce\AdminBundle\Compiler\Loader\AdminLoader $loader) { foreach ($tree as $admin_name => $child) { $admin = $loader->getAdminByName($admin_name); if ($admin->workflow) { foreach ($admin->workflow['status'] as $step_name => $step) { if (!$step['duty']) { continue; } if ($step['role'] && !$this->get('security.context')->isGranted($step['role'])) { continue; } // count the status $count = $admin->getRouteWorkflowCount($step_name); if ($count < 1) { continue; } $duty_count[$admin_name][$step_name] = $count; } } if ($child) { $this->getDutyCount($child, $duty_count, $loader); } } }
private function tree(array &$tree, InputInterface $input, OutputInterface $output) { foreach ($tree as $admin_name => $children) { $admin = $this->loader->getAdminByName($admin_name); if ($admin->workflow) { $this->check($admin, $input, $output); } if ($children) { $this->tree($children, $input, $output); } } }
public function sf_admin_path($admin, $action, $object = null, $options = array()) { $admin = $this->admin_loader->getAdminByName($admin); return $admin->path($action, $object, $options); }