/** * @param int $amount * @param FrontendUser[] $speakers * @param array $recurringSpeakersPerSessionPercentage * @return AcceptedSession[] */ protected function createSessions($amount, array $speakers, array $recurringSpeakersPerSessionPercentage = []) { $sessions = []; for ($i = 1; $i <= $amount; $i++) { $randomSpeaker = $speakers[array_rand($speakers)]; $session = new AcceptedSession(); $session->_setProperty('uid', $i + 3000); $session->_setProperty('votes', rand(0, 500)); $session->setTitle('Session #' . $i); $session->addSpeaker($randomSpeaker); $sessions[] = $session; } return $sessions; }