Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
55 | public function benchHydration() |
||
56 | { |
||
57 | // Yes, this is a lot of overhead, but I have no better solution other than |
||
58 | // completely mocking out the DB, which would be silly (query impact is |
||
59 | // necessarily part of our benchmarks) |
||
60 | $this->entityManager->getConnection()->executeQuery('DELETE FROM ' . $this->tableName)->execute(); |
||
61 | |||
62 | foreach ($this->users as $key => $user) { |
||
63 | $this->entityManager->persist($user); |
||
64 | |||
65 | if (! ($key % 20)) { |
||
66 | $this->entityManager->flush(); |
||
67 | $this->entityManager->clear(); |
||
68 | } |
||
69 | } |
||
70 | } |
||
71 | } |
||
72 |