This commit is contained in:
Alexey Skobkin 2017-01-14 04:02:04 +03:00
parent 1b2df8d4c3
commit 34a9aa8caf

View file

@ -32,6 +32,7 @@ class LoadSubscribersData extends AbstractFixture implements OrderedFixtureInter
]; ];
foreach ($users as $key => $user) { foreach ($users as $key => $user) {
if (array_key_exists($key, $subscriptions)) {
foreach ($subscriptions[$key] as $userId) { foreach ($subscriptions[$key] as $userId) {
$subscriber = $users[$userId]; $subscriber = $users[$userId];
$subscription = new Subscription($user, $subscriber); $subscription = new Subscription($user, $subscriber);
@ -41,6 +42,7 @@ class LoadSubscribersData extends AbstractFixture implements OrderedFixtureInter
$user->addSubscriber($subscription); $user->addSubscriber($subscription);
} }
} }
}
$om->flush(); $om->flush();
} }