LoadSubscribersData possible fix.
This commit is contained in:
parent
706933b405
commit
88105a4ef1
|
@ -33,9 +33,8 @@ class LoadSubscribersData extends AbstractFixture implements OrderedFixtureInter
|
|||
$minimum = mt_rand(0, count($users));
|
||||
}
|
||||
|
||||
$subscribers = $this->getRandomSubscribers($users, $minimum);
|
||||
|
||||
foreach ($subscribers as $subscriber) {
|
||||
if ($minimum) {
|
||||
foreach ($this->getRandomSubscribers($users, $minimum) as $subscriber) {
|
||||
$subscription = new Subscription($user,$subscriber);
|
||||
$subscriptionEvent = new SubscriptionEvent($user, $subscriber, SubscriptionEvent::ACTION_SUBSCRIBE);
|
||||
$om->persist($subscription);
|
||||
|
@ -43,6 +42,7 @@ class LoadSubscribersData extends AbstractFixture implements OrderedFixtureInter
|
|||
$user->addSubscriber($subscription);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$om->flush();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue