protected function execute($arguments = array(), $options = array()) { $databaseManager = new sfDatabaseManager($this->configuration); $this->conn = $databaseManager->getDatabase('doctrine')->getDoctrineConnection(); $communityIds = $this->getCommunityIds(); for ($i=0; $i < $options['communitynumber']; ++$i) { $communityId = $this->fetchRandomCommunityId($communityIds); $topicIds = $this->getTopicIds($communityId); $memberIds = $this->getMemberIds($communityId); for ($j=0; $j < $options['topicnumber']; ++$j) { for ($k=0; $k < $options['number']; ++$k) { $ctc = new CommunityTopicComment(); $ctc->setMemberId(self::fetchRandomMemberId($memberIds)); $ctc->setCommunityTopicId(self::fetchRandomTopicId($topicIds)); $ctc->setBody('body'); $ctc->save(); $ctc->free(); $this->logSection('created a community topic comment', sprintf("%s", $communityId)); } } } }