mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-03 21:34:59 +00:00
adapting classes to new interfaces
This commit is contained in:
@@ -23,6 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Chill\MainBundle\Export\AggregatorInterface;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -86,9 +87,28 @@ class ReasonAggregator implements AggregatorInterface
|
||||
return "Aggregate by activity reason";
|
||||
}
|
||||
|
||||
public function requiredRole()
|
||||
public function addRole()
|
||||
{
|
||||
return new Role('dummy');
|
||||
return new Role(ActivityVoter::SEE);
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
{
|
||||
return array_combine($values, $values);
|
||||
|
||||
}
|
||||
|
||||
public function getQueryKeys($data)
|
||||
{
|
||||
// add select element
|
||||
if ($data['level'] === 'reason') {
|
||||
return array('activity_reason_id');
|
||||
} elseif ($data['level'] === 'category') {
|
||||
return array ('activity_category_id');
|
||||
} else {
|
||||
throw new \RuntimeException('the data provided are not recognised');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user