This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
34
{
35
/**
36
* Implement entity handling in form
37
*/
38
use TEntityContainer;
39
40
/**
41
* Implement form methods
42
*/
43
use TForm;
44
45
/**
46
* @var ORM\EntityManager
47
*/
48
private $entityManager;
49
50
/**
51
* @param ORM\EntityManager $entityManager
52
*/
53
public function injectEntityManager(ORM\EntityManager $entityManager)
54
{
55
$this->entityManager = $entityManager;
56
}
57
58
/**
59
* Adds naming container to the form
60
*
61
* @param string $name
62
*
63
* @return EntityContainer
64
*/
65
public function addContainer($name) : EntityContainer
66
{
67
$control = new EntityContainer($this->entityManager);
68
$control->setCurrentGroup($this->currentGroup);
69
70
return $this[$name] = $control;
71
}
72
73
/**
74
* @return ORM\EntityManager
75
*/
76
protected function getEntityManager() : ORM\EntityManager
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.