| 1 | <?php |
||
| 9 | trait DoctrineHelper |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * Execute a DQL query (only for SELECT, UPDATE or DELETE) |
||
| 13 | * |
||
| 14 | * @param string $dql |
||
| 15 | * @param array $parameters |
||
| 16 | * @return mixed |
||
| 17 | */ |
||
| 18 | protected function executeDQL($dql, array $parameters = array()) |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Execute raw SQL |
||
| 30 | * |
||
| 31 | * @param string $sql |
||
| 32 | * @param array $parameters |
||
| 33 | * @return \Doctrine\DBAL\Statement |
||
| 34 | */ |
||
| 35 | protected function executeSQL($sql, array $parameters = array()) |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Drop tables if exists |
||
| 48 | * |
||
| 49 | * @param array $tables |
||
| 50 | */ |
||
| 51 | protected function dropTables(array $tables) |
||
| 57 | } |
||
| 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: