complete missing annotations

This commit is contained in:
2021-02-02 11:49:27 +01:00
parent 0b8a22ae46
commit 01e93f7ba3
4 changed files with 66 additions and 11 deletions

View File

@@ -24,25 +24,23 @@ use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\PropertyAccess\PropertyAccess;
/**
*
* Class Resolver
*
* @package Chill\MainBundle\CRUD\Resolver
*/
class Resolver
{
/**
*
* @var EntityManagerInterface
*/
protected $em;
/**
*
* @var \Symfony\Component\PropertyAccess\PropertyAccessor
*/
protected $propertyAccess;
/**
*
* @var array
*/
protected $crudConfig;
@@ -62,6 +60,12 @@ class Resolver
*/
const ROLE = 'role';
/**
* Resolver constructor.
*
* @param EntityManagerInterface $em
* @param array $crudConfig
*/
function __construct(EntityManagerInterface $em, array $crudConfig)
{
$this->em = $em;
@@ -71,6 +75,12 @@ class Resolver
}
}
/**
* @param $key
* @param $crudName
* @param null $action
* @return string
*/
public function getConfigValue($key, $crudName, $action = null)
{
$config = $this->crudConfig[$crudName];
@@ -81,6 +91,11 @@ class Resolver
}
}
/**
* @param $crudName
* @param $action
* @return string
*/
public function buildDefaultRole($crudName, $action)
{
if (empty($this->crudConfig[$crudName]['base_role'])) {
@@ -94,9 +109,14 @@ class Resolver
$action);
}
/**
* @param $crudName
* @param $action
* @return bool
*/
public function hasAction($crudName, $action)
{
return \array_key_exists($action,
return \array_key_exists($action,
$this->crudConfig[$crudName]['actions']);
}
}