Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
1 | <?php |
||
18 | protected function executeDQL($dql, array $parameters = array()) |
||
19 | { |
||
20 | $em = $this->container->get('doctrine')->getManager(); |
||
|
|||
21 | $query = $em->createQuery($dql); |
||
22 | foreach ($parameters as $name => $value) { |
||
23 | $query->setParameter($name, $value); |
||
24 | } |
||
25 | return $query->getResult(); |
||
26 | } |
||
27 | |||
58 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: