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...
32
{
33
/**
34
* Implement entity handling in form
35
*/
36
use TEntityContainer;
37
38
/**
39
* Implement form methods
40
*/
41
use TForm;
42
43
/**
44
* @var ORM\EntityManager
45
*/
46
private $entityManager;
47
48
/**
49
* @param ORM\EntityManager $entityManager
50
*/
51
public function injectEntityManager(ORM\EntityManager $entityManager) : void
52
{
53
$this->entityManager = $entityManager;
54
}
55
56
/**
57
* Adds naming container to the form
58
*
59
* @param string $name
60
*
61
* @return EntityContainer
62
*/
63
public function addContainer($name) : EntityContainer
64
{
65
$control = new EntityContainer($this->entityManager);
66
$control->setCurrentGroup($this->currentGroup);
67
68
return $this[$name] = $control;
69
}
70
71
/**
72
* @return ORM\EntityManager
73
*/
74
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.