@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public function __construct($debug) |
| 31 | 31 | { |
| 32 | - $this->debug = (bool) $debug; |
|
| 32 | + $this->debug = (bool)$debug; |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | ->fixXmlConfig('fallback') |
| 57 | 57 | ->children() |
| 58 | 58 | ->arrayNode('fallbacks') |
| 59 | - ->beforeNormalization()->ifString()->then(function ($v) { |
|
| 59 | + ->beforeNormalization()->ifString()->then(function($v) { |
|
| 60 | 60 | return [$v]; |
| 61 | 61 | })->end() |
| 62 | 62 | ->prototype('scalar')->end() |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | case 0: |
| 64 | 64 | echo "case 0"; |
| 65 | 65 | } |
| 66 | -EOF |
|
| 66 | +eof |
|
| 67 | 67 | ]; |
| 68 | 68 | |
| 69 | 69 | // #2 switch with two cases, second with break |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | echo "case 1"; |
| 90 | 90 | break; |
| 91 | 91 | } |
| 92 | -EOF |
|
| 92 | +eof |
|
| 93 | 93 | ]; |
| 94 | 94 | |
| 95 | 95 | // #3 switch with two cases (second with break) and default |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | default: |
| 118 | 118 | echo "default case"; |
| 119 | 119 | } |
| 120 | -EOF |
|
| 120 | +eof |
|
| 121 | 121 | ]; |
| 122 | 122 | |
| 123 | 123 | // #4 switch with two cases (first without body, second with break) and default |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | default: |
| 145 | 145 | echo "default case"; |
| 146 | 146 | } |
| 147 | -EOF |
|
| 147 | +eof |
|
| 148 | 148 | ]; |
| 149 | 149 | |
| 150 | 150 | return $tests; |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | |
| 27 | 27 | $fs = new Filesystem(); |
| 28 | 28 | if (!$fs->isAbsolutePath($config)) { |
| 29 | - $config = __DIR__.'/config/'.$config; |
|
| 29 | + $config = __DIR__ . '/config/' . $config; |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | if (!file_exists($config)) { |
@@ -118,7 +118,7 @@ |
||
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | 120 | } |
| 121 | -EOF |
|
| 121 | +eof |
|
| 122 | 122 | ; |
| 123 | 123 | |
| 124 | 124 | return json_decode($json, true); |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | ->setDescription('Loads bundles into persistences') |
| 25 | 25 | ->setHelp(<<<'EOT' |
| 26 | 26 | The <info>scan:bundles</info> command loads bundle table. |
| 27 | -EOT |
|
| 27 | +eot |
|
| 28 | 28 | ) |
| 29 | 29 | ->setDefinition([ |
| 30 | 30 | new InputArgument('create', InputArgument::OPTIONAL, 'Create schema'), |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | { |
| 51 | 51 | // Remove the following lines when you implement this test. |
| 52 | 52 | $this->markTestIncomplete( |
| 53 | - 'This test has not been implemented yet.' |
|
| 53 | + 'This test has not been implemented yet.' |
|
| 54 | 54 | ); |
| 55 | 55 | } |
| 56 | 56 | |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | { |
| 63 | 63 | // Remove the following lines when you implement this test. |
| 64 | 64 | $this->markTestIncomplete( |
| 65 | - 'This test has not been implemented yet.' |
|
| 65 | + 'This test has not been implemented yet.' |
|
| 66 | 66 | ); |
| 67 | 67 | } |
| 68 | 68 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | { |
| 75 | 75 | // Remove the following lines when you implement this test. |
| 76 | 76 | $this->markTestIncomplete( |
| 77 | - 'This test has not been implemented yet.' |
|
| 77 | + 'This test has not been implemented yet.' |
|
| 78 | 78 | ); |
| 79 | 79 | } |
| 80 | 80 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | { |
| 87 | 87 | // Remove the following lines when you implement this test. |
| 88 | 88 | $this->markTestIncomplete( |
| 89 | - 'This test has not been implemented yet.' |
|
| 89 | + 'This test has not been implemented yet.' |
|
| 90 | 90 | ); |
| 91 | 91 | } |
| 92 | 92 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | { |
| 99 | 99 | // Remove the following lines when you implement this test. |
| 100 | 100 | $this->markTestIncomplete( |
| 101 | - 'This test has not been implemented yet.' |
|
| 101 | + 'This test has not been implemented yet.' |
|
| 102 | 102 | ); |
| 103 | 103 | } |
| 104 | 104 | |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | { |
| 111 | 111 | // Remove the following lines when you implement this test. |
| 112 | 112 | $this->markTestIncomplete( |
| 113 | - 'This test has not been implemented yet.' |
|
| 113 | + 'This test has not been implemented yet.' |
|
| 114 | 114 | ); |
| 115 | 115 | } |
| 116 | 116 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | { |
| 123 | 123 | // Remove the following lines when you implement this test. |
| 124 | 124 | $this->markTestIncomplete( |
| 125 | - 'This test has not been implemented yet.' |
|
| 125 | + 'This test has not been implemented yet.' |
|
| 126 | 126 | ); |
| 127 | 127 | } |
| 128 | 128 | |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | { |
| 135 | 135 | // Remove the following lines when you implement this test. |
| 136 | 136 | $this->markTestIncomplete( |
| 137 | - 'This test has not been implemented yet.' |
|
| 137 | + 'This test has not been implemented yet.' |
|
| 138 | 138 | ); |
| 139 | 139 | } |
| 140 | 140 | } |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | { |
| 50 | 50 | // Remove the following lines when you implement this test. |
| 51 | 51 | $this->markTestIncomplete( |
| 52 | - 'This test has not been implemented yet.' |
|
| 52 | + 'This test has not been implemented yet.' |
|
| 53 | 53 | ); |
| 54 | 54 | } |
| 55 | 55 | |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | { |
| 62 | 62 | // Remove the following lines when you implement this test. |
| 63 | 63 | $this->markTestIncomplete( |
| 64 | - 'This test has not been implemented yet.' |
|
| 64 | + 'This test has not been implemented yet.' |
|
| 65 | 65 | ); |
| 66 | 66 | } |
| 67 | 67 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | { |
| 74 | 74 | // Remove the following lines when you implement this test. |
| 75 | 75 | $this->markTestIncomplete( |
| 76 | - 'This test has not been implemented yet.' |
|
| 76 | + 'This test has not been implemented yet.' |
|
| 77 | 77 | ); |
| 78 | 78 | } |
| 79 | 79 | |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | { |
| 86 | 86 | // Remove the following lines when you implement this test. |
| 87 | 87 | $this->markTestIncomplete( |
| 88 | - 'This test has not been implemented yet.' |
|
| 88 | + 'This test has not been implemented yet.' |
|
| 89 | 89 | ); |
| 90 | 90 | } |
| 91 | 91 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | { |
| 98 | 98 | // Remove the following lines when you implement this test. |
| 99 | 99 | $this->markTestIncomplete( |
| 100 | - 'This test has not been implemented yet.' |
|
| 100 | + 'This test has not been implemented yet.' |
|
| 101 | 101 | ); |
| 102 | 102 | } |
| 103 | 103 | } |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | { |
| 51 | 51 | // Remove the following lines when you implement this test. |
| 52 | 52 | $this->markTestIncomplete( |
| 53 | - 'This test has not been implemented yet.' |
|
| 53 | + 'This test has not been implemented yet.' |
|
| 54 | 54 | ); |
| 55 | 55 | } |
| 56 | 56 | |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | { |
| 63 | 63 | // Remove the following lines when you implement this test. |
| 64 | 64 | $this->markTestIncomplete( |
| 65 | - 'This test has not been implemented yet.' |
|
| 65 | + 'This test has not been implemented yet.' |
|
| 66 | 66 | ); |
| 67 | 67 | } |
| 68 | 68 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | { |
| 75 | 75 | // Remove the following lines when you implement this test. |
| 76 | 76 | $this->markTestIncomplete( |
| 77 | - 'This test has not been implemented yet.' |
|
| 77 | + 'This test has not been implemented yet.' |
|
| 78 | 78 | ); |
| 79 | 79 | } |
| 80 | 80 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | { |
| 87 | 87 | // Remove the following lines when you implement this test. |
| 88 | 88 | $this->markTestIncomplete( |
| 89 | - 'This test has not been implemented yet.' |
|
| 89 | + 'This test has not been implemented yet.' |
|
| 90 | 90 | ); |
| 91 | 91 | } |
| 92 | 92 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | { |
| 99 | 99 | // Remove the following lines when you implement this test. |
| 100 | 100 | $this->markTestIncomplete( |
| 101 | - 'This test has not been implemented yet.' |
|
| 101 | + 'This test has not been implemented yet.' |
|
| 102 | 102 | ); |
| 103 | 103 | } |
| 104 | 104 | |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | { |
| 111 | 111 | // Remove the following lines when you implement this test. |
| 112 | 112 | $this->markTestIncomplete( |
| 113 | - 'This test has not been implemented yet.' |
|
| 113 | + 'This test has not been implemented yet.' |
|
| 114 | 114 | ); |
| 115 | 115 | } |
| 116 | 116 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | { |
| 123 | 123 | // Remove the following lines when you implement this test. |
| 124 | 124 | $this->markTestIncomplete( |
| 125 | - 'This test has not been implemented yet.' |
|
| 125 | + 'This test has not been implemented yet.' |
|
| 126 | 126 | ); |
| 127 | 127 | } |
| 128 | 128 | |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | { |
| 135 | 135 | // Remove the following lines when you implement this test. |
| 136 | 136 | $this->markTestIncomplete( |
| 137 | - 'This test has not been implemented yet.' |
|
| 137 | + 'This test has not been implemented yet.' |
|
| 138 | 138 | ); |
| 139 | 139 | } |
| 140 | 140 | |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | { |
| 147 | 147 | // Remove the following lines when you implement this test. |
| 148 | 148 | $this->markTestIncomplete( |
| 149 | - 'This test has not been implemented yet.' |
|
| 149 | + 'This test has not been implemented yet.' |
|
| 150 | 150 | ); |
| 151 | 151 | } |
| 152 | 152 | } |
@@ -72,10 +72,10 @@ discard block |
||
| 72 | 72 | public function getSubscriberByEventName($eventName) |
| 73 | 73 | { |
| 74 | 74 | return $this->em->createQueryBuilder()->select('t') |
| 75 | - ->from('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookSubscriberEntity', 't') |
|
| 76 | - ->where('t.eventname = ?1') |
|
| 77 | - ->getQuery()->setParameter(1, $eventName) |
|
| 78 | - ->getArrayResult(); |
|
| 75 | + ->from('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookSubscriberEntity', 't') |
|
| 76 | + ->where('t.eventname = ?1') |
|
| 77 | + ->getQuery()->setParameter(1, $eventName) |
|
| 78 | + ->getArrayResult(); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | public function unregisterSubscriberByArea($areaName) |
@@ -88,24 +88,24 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | // delete subscriber entry |
| 90 | 90 | $this->em->createQueryBuilder() |
| 91 | - ->delete('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookSubscriberEntity', 't') |
|
| 92 | - ->where('t.sareaid = ?1') |
|
| 93 | - ->getQuery()->setParameter(1, $areaId) |
|
| 94 | - ->execute(); |
|
| 91 | + ->delete('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookSubscriberEntity', 't') |
|
| 92 | + ->where('t.sareaid = ?1') |
|
| 93 | + ->getQuery()->setParameter(1, $areaId) |
|
| 94 | + ->execute(); |
|
| 95 | 95 | |
| 96 | 96 | // remove bindings |
| 97 | 97 | $this->em->createQueryBuilder() |
| 98 | - ->delete('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookBindingEntity', 't') |
|
| 99 | - ->where('t.sareaid = ?1') |
|
| 100 | - ->getQuery()->setParameter(1, $areaId) |
|
| 101 | - ->execute(); |
|
| 98 | + ->delete('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookBindingEntity', 't') |
|
| 99 | + ->where('t.sareaid = ?1') |
|
| 100 | + ->getQuery()->setParameter(1, $areaId) |
|
| 101 | + ->execute(); |
|
| 102 | 102 | |
| 103 | 103 | // clean areas |
| 104 | 104 | $this->em->createQueryBuilder() |
| 105 | - ->delete('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookAreaEntity', 't') |
|
| 106 | - ->where('t.id = ?1') |
|
| 107 | - ->getQuery()->setParameter(1, $areaId) |
|
| 108 | - ->execute(); |
|
| 105 | + ->delete('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookAreaEntity', 't') |
|
| 106 | + ->where('t.id = ?1') |
|
| 107 | + ->getQuery()->setParameter(1, $areaId) |
|
| 108 | + ->execute(); |
|
| 109 | 109 | |
| 110 | 110 | $this->generateRuntimeHandlers(); |
| 111 | 111 | } |
@@ -164,24 +164,24 @@ discard block |
||
| 164 | 164 | |
| 165 | 165 | // delete provider entry |
| 166 | 166 | $this->em->createQueryBuilder() |
| 167 | - ->delete('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookProviderEntity', 't') |
|
| 168 | - ->where('t.pareaid = ?1') |
|
| 169 | - ->getQuery()->setParameter(1, $areaId) |
|
| 170 | - ->execute(); |
|
| 167 | + ->delete('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookProviderEntity', 't') |
|
| 168 | + ->where('t.pareaid = ?1') |
|
| 169 | + ->getQuery()->setParameter(1, $areaId) |
|
| 170 | + ->execute(); |
|
| 171 | 171 | |
| 172 | 172 | // remove bindings |
| 173 | 173 | $this->em->createQueryBuilder() |
| 174 | - ->delete('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookBindingEntity', 't') |
|
| 175 | - ->where('t.pareaid = ?1') |
|
| 176 | - ->getQuery()->setParameter(1, $areaId) |
|
| 177 | - ->execute(); |
|
| 174 | + ->delete('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookBindingEntity', 't') |
|
| 175 | + ->where('t.pareaid = ?1') |
|
| 176 | + ->getQuery()->setParameter(1, $areaId) |
|
| 177 | + ->execute(); |
|
| 178 | 178 | |
| 179 | 179 | // clean area |
| 180 | 180 | $this->em->createQueryBuilder() |
| 181 | - ->delete('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookAreaEntity', 't') |
|
| 182 | - ->where('t.id = ?1') |
|
| 183 | - ->getQuery()->setParameter(1, $areaId) |
|
| 184 | - ->execute(); |
|
| 181 | + ->delete('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookAreaEntity', 't') |
|
| 182 | + ->where('t.id = ?1') |
|
| 183 | + ->getQuery()->setParameter(1, $areaId) |
|
| 184 | + ->execute(); |
|
| 185 | 185 | |
| 186 | 186 | $this->generateRuntimeHandlers(); |
| 187 | 187 | } |
@@ -239,9 +239,9 @@ discard block |
||
| 239 | 239 | { |
| 240 | 240 | // truncate runtime |
| 241 | 241 | $this->em->createQueryBuilder() |
| 242 | - ->delete('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookRuntimeEntity') |
|
| 243 | - ->getQuery() |
|
| 244 | - ->execute(); |
|
| 242 | + ->delete('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookRuntimeEntity') |
|
| 243 | + ->getQuery() |
|
| 244 | + ->execute(); |
|
| 245 | 245 | |
| 246 | 246 | foreach ($this->getBindings() as $binding) { |
| 247 | 247 | $this->addRuntimeHandlers($binding['sareaid'], $binding['pareaid']); |
@@ -251,9 +251,9 @@ discard block |
||
| 251 | 251 | private function addRuntimeHandlers($subscriberAreaId, $providerAreaId) |
| 252 | 252 | { |
| 253 | 253 | $sa = $this->em->find('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookAreaEntity', |
| 254 | - $subscriberAreaId); |
|
| 254 | + $subscriberAreaId); |
|
| 255 | 255 | $pa = $this->em->find('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookAreaEntity', |
| 256 | - $providerAreaId); |
|
| 256 | + $providerAreaId); |
|
| 257 | 257 | |
| 258 | 258 | $subscribers = $this->em->createQueryBuilder()->select('t') |
| 259 | 259 | ->from('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookSubscriberEntity', 't') |
@@ -267,10 +267,10 @@ discard block |
||
| 267 | 267 | |
| 268 | 268 | foreach ($subscribers as $subscriber) { |
| 269 | 269 | $provider = $this->em->createQueryBuilder()->select('t') |
| 270 | - ->from('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookProviderEntity', 't') |
|
| 271 | - ->where('t.pareaid = ?1 AND t.hooktype = ?2') |
|
| 272 | - ->getQuery()->setParameters([1 => $providerAreaId, 2 => $subscriber['hooktype']]) |
|
| 273 | - ->getArrayResult(); |
|
| 270 | + ->from('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookProviderEntity', 't') |
|
| 271 | + ->where('t.pareaid = ?1 AND t.hooktype = ?2') |
|
| 272 | + ->getQuery()->setParameters([1 => $providerAreaId, 2 => $subscriber['hooktype']]) |
|
| 273 | + ->getArrayResult(); |
|
| 274 | 274 | |
| 275 | 275 | if ($provider) { |
| 276 | 276 | $provider = $provider[0]; |
@@ -298,9 +298,9 @@ discard block |
||
| 298 | 298 | { |
| 299 | 299 | $this->runtimeHandlers = |
| 300 | 300 | $this->em->createQueryBuilder()->select('t') |
| 301 | - ->from('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookRuntimeEntity', 't') |
|
| 302 | - ->getQuery() |
|
| 303 | - ->getArrayResult(); |
|
| 301 | + ->from('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookRuntimeEntity', 't') |
|
| 302 | + ->getQuery() |
|
| 303 | + ->getArrayResult(); |
|
| 304 | 304 | |
| 305 | 305 | return $this->runtimeHandlers; |
| 306 | 306 | } |
@@ -308,9 +308,9 @@ discard block |
||
| 308 | 308 | public function bindSubscriber($subscriberArea, $providerArea) |
| 309 | 309 | { |
| 310 | 310 | $sa = $this->em->getRepository('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookAreaEntity') |
| 311 | - ->findOneBy(['areaname' => $subscriberArea]); |
|
| 311 | + ->findOneBy(['areaname' => $subscriberArea]); |
|
| 312 | 312 | $pa = $this->em->getRepository('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookAreaEntity') |
| 313 | - ->findOneBy(['areaname' => $providerArea]); |
|
| 313 | + ->findOneBy(['areaname' => $providerArea]); |
|
| 314 | 314 | |
| 315 | 315 | if ($sa->getCategory() != $pa->getCategory()) { |
| 316 | 316 | throw new \LogicException('Cannot bind areas from different categories.'); |
@@ -334,18 +334,18 @@ discard block |
||
| 334 | 334 | public function unbindSubscriber($subscriberArea, $providerArea) |
| 335 | 335 | { |
| 336 | 336 | $sa = $this->em->getRepository('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookAreaEntity') |
| 337 | - ->findOneBy(['areaname' => $subscriberArea]); |
|
| 337 | + ->findOneBy(['areaname' => $subscriberArea]); |
|
| 338 | 338 | $pa = $this->em->getRepository('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookAreaEntity') |
| 339 | - ->findOneBy(['areaname' => $providerArea]); |
|
| 339 | + ->findOneBy(['areaname' => $providerArea]); |
|
| 340 | 340 | |
| 341 | 341 | $subscriberAreaId = $sa->getId(); |
| 342 | 342 | $providerAreaId = $pa->getId(); |
| 343 | 343 | |
| 344 | 344 | $this->em->createQueryBuilder() |
| 345 | - ->delete('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookBindingEntity', 't') |
|
| 346 | - ->where('t.pareaid = ?1 AND t.sareaid = ?2') |
|
| 347 | - ->getQuery()->setParameters([1 => $providerAreaId, 2 => $subscriberAreaId]) |
|
| 348 | - ->execute(); |
|
| 345 | + ->delete('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookBindingEntity', 't') |
|
| 346 | + ->where('t.pareaid = ?1 AND t.sareaid = ?2') |
|
| 347 | + ->getQuery()->setParameters([1 => $providerAreaId, 2 => $subscriberAreaId]) |
|
| 348 | + ->execute(); |
|
| 349 | 349 | |
| 350 | 350 | $this->generateRuntimeHandlers(); |
| 351 | 351 | } |
@@ -357,16 +357,16 @@ discard block |
||
| 357 | 357 | $order->add('t.sortorder', 'ASC'); |
| 358 | 358 | |
| 359 | 359 | return $this->em->createQueryBuilder()->select('t') |
| 360 | - ->from('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookBindingEntity', 't') |
|
| 361 | - ->orderBy($order) |
|
| 362 | - ->getQuery() |
|
| 363 | - ->getArrayResult(); |
|
| 360 | + ->from('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookBindingEntity', 't') |
|
| 361 | + ->orderBy($order) |
|
| 362 | + ->getQuery() |
|
| 363 | + ->getArrayResult(); |
|
| 364 | 364 | } |
| 365 | 365 | |
| 366 | 366 | public function getBindingsFor($areaName) |
| 367 | 367 | { |
| 368 | 368 | $area = $this->em->getRepository('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookAreaEntity') |
| 369 | - ->findOneBy(['areaname' => $areaName]); |
|
| 369 | + ->findOneBy(['areaname' => $areaName]); |
|
| 370 | 370 | |
| 371 | 371 | if (!$area) { |
| 372 | 372 | return []; |
@@ -382,11 +382,11 @@ discard block |
||
| 382 | 382 | $order->add('t.sortorder', 'ASC'); |
| 383 | 383 | $order->add('t.sareaid', 'ASC'); |
| 384 | 384 | $results = $this->em->createQueryBuilder()->select('t') |
| 385 | - ->from('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookBindingEntity', 't') |
|
| 386 | - ->where("t.$areaIdField = ?1") |
|
| 387 | - ->orderBy($order) |
|
| 388 | - ->getQuery()->setParameter(1, $area->getId()) |
|
| 389 | - ->getArrayResult(); |
|
| 385 | + ->from('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookBindingEntity', 't') |
|
| 386 | + ->where("t.$areaIdField = ?1") |
|
| 387 | + ->orderBy($order) |
|
| 388 | + ->getQuery()->setParameter(1, $area->getId()) |
|
| 389 | + ->getArrayResult(); |
|
| 390 | 390 | |
| 391 | 391 | // this could be an area where related entities would help CAH - 23 Oct 2013 |
| 392 | 392 | $areas = []; |
@@ -413,18 +413,18 @@ discard block |
||
| 413 | 413 | foreach ($providerAreaNames as $name) { |
| 414 | 414 | $providerAreaIds[] = |
| 415 | 415 | $this->em->getRepository('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookAreaEntity') |
| 416 | - ->findOneBy(['areaname' => $name]) |
|
| 417 | - ->getId(); |
|
| 416 | + ->findOneBy(['areaname' => $name]) |
|
| 417 | + ->getId(); |
|
| 418 | 418 | } |
| 419 | 419 | |
| 420 | 420 | // sort bindings in order of appearance from $providerAreaIds |
| 421 | 421 | $counter = 1; |
| 422 | 422 | foreach ($providerAreaIds as $id) { |
| 423 | 423 | $this->em->createQueryBuilder() |
| 424 | - ->update('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookBindingEntity', 't') |
|
| 425 | - ->set('t.sortorder', $counter) |
|
| 426 | - ->where('t.sareaid = ?1 AND t.pareaid = ?2') |
|
| 427 | - ->getQuery()->setParameters([1 => $sareaId, 2 => $id]) |
|
| 424 | + ->update('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookBindingEntity', 't') |
|
| 425 | + ->set('t.sortorder', $counter) |
|
| 426 | + ->where('t.sareaid = ?1 AND t.pareaid = ?2') |
|
| 427 | + ->getQuery()->setParameters([1 => $sareaId, 2 => $id]) |
|
| 428 | 428 | ->execute(); |
| 429 | 429 | $counter++; |
| 430 | 430 | } |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | |
| 472 | 472 | $subscribers = |
| 473 | 473 | $this->em->getRepository('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookSubscriberEntity') |
| 474 | - ->findBy(['sareaid' => $sareaId]); |
|
| 474 | + ->findBy(['sareaid' => $sareaId]); |
|
| 475 | 475 | |
| 476 | 476 | if (!$subscribers) { |
| 477 | 477 | return false; |
@@ -482,8 +482,8 @@ discard block |
||
| 482 | 482 | foreach ($subscribers as $subscriber) { |
| 483 | 483 | $pareaId = |
| 484 | 484 | $this->em->getRepository('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookAreaEntity') |
| 485 | - ->findOneBy(['areaname' => $providerArea]) |
|
| 486 | - ->getId(); |
|
| 485 | + ->findOneBy(['areaname' => $providerArea]) |
|
| 486 | + ->getId(); |
|
| 487 | 487 | |
| 488 | 488 | $hookprovider = |
| 489 | 489 | $this->em->createQueryBuilder()->select('t') |
@@ -494,7 +494,7 @@ discard block |
||
| 494 | 494 | 2 => $subscriber->getHooktype(), |
| 495 | 495 | 3 => $subscriber->getCategory() |
| 496 | 496 | ]) |
| 497 | - ->getArrayResult(); |
|
| 497 | + ->getArrayResult(); |
|
| 498 | 498 | |
| 499 | 499 | if ($hookprovider) { |
| 500 | 500 | $allow = true; |
@@ -542,7 +542,7 @@ discard block |
||
| 542 | 542 | public function getAreaId($areaName) |
| 543 | 543 | { |
| 544 | 544 | $hookArea = $this->em->getRepository('Zikula\Bundle\HookBundle\Dispatcher\Storage\Doctrine\Entity\HookAreaEntity') |
| 545 | - ->findOneBy(['areaname' => $areaName]); |
|
| 545 | + ->findOneBy(['areaname' => $areaName]); |
|
| 546 | 546 | |
| 547 | 547 | if (!$hookArea) { |
| 548 | 548 | return false; |
@@ -374,7 +374,8 @@ |
||
| 374 | 374 | |
| 375 | 375 | if ($area->getAreatype() == self::PROVIDER) { |
| 376 | 376 | $areaIdField = 'pareaid'; |
| 377 | - } else { // $area->getAreatype() == self::SUBSCRIBER |
|
| 377 | + } else { |
|
| 378 | +// $area->getAreatype() == self::SUBSCRIBER |
|
| 378 | 379 | $areaIdField = 'sareaid'; |
| 379 | 380 | } |
| 380 | 381 | |