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));
|
$minimum = mt_rand(0, count($users));
|
||||||
}
|
}
|
||||||
|
|
||||||
$subscribers = $this->getRandomSubscribers($users, $minimum);
|
if ($minimum) {
|
||||||
|
foreach ($this->getRandomSubscribers($users, $minimum) as $subscriber) {
|
||||||
foreach ($subscribers as $subscriber) {
|
|
||||||
$subscription = new Subscription($user,$subscriber);
|
$subscription = new Subscription($user,$subscriber);
|
||||||
$subscriptionEvent = new SubscriptionEvent($user, $subscriber, SubscriptionEvent::ACTION_SUBSCRIBE);
|
$subscriptionEvent = new SubscriptionEvent($user, $subscriber, SubscriptionEvent::ACTION_SUBSCRIBE);
|
||||||
$om->persist($subscription);
|
$om->persist($subscription);
|
||||||
|
@ -43,6 +42,7 @@ class LoadSubscribersData extends AbstractFixture implements OrderedFixtureInter
|
||||||
$user->addSubscriber($subscription);
|
$user->addSubscriber($subscription);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$om->flush();
|
$om->flush();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue