public function activationEmailResend($limit = 10) 
    {
		$main = $this->getServiceLocator()->get('neobazaar.service.main');
		$em = $main->getEntityManager();
		$cache = $this->getServiceLocator()->get('ClassifiedCache');
		$documentRepository = $main->getDocumentEntityRepository();
		$documents = $documentRepository->getClassifiedsThatNeedActivationEmailToBeResent($limit); 
        $url = $this->getServiceLocator()->get('ControllerPluginManager')->get('Url');
        
		$ids = array();
		foreach ($documents as $document) {
		    $url = $this->getServiceLocator()->get('ControllerPluginManager')->get('Url');
		    $classifiedModel = $this->getServiceLocator()->get('document.model.classifiedAdminListing');
		    $classifiedModel->init($document, $this->getServiceLocator());
		    $event = new ClassifiedCreatedEvent('save', null, array(
    		    'to' => $classifiedModel->email, 
    		    'siteurl' => $url->fromRoute('home', array(), array('force_canonical' => true)),
    		    'fullname' => $classifiedModel->fullname,
		        'title' => $classifiedModel->title, 
		        'hash' => $classifiedModel->hashId,
		        'state' => $classifiedModel->state
    		));
            
		    // Add 1 second to date edit
		    $dateInsert = $document->getDateInsert();
		    $interval = new \DateInterval('PT1S'); // 1 second
		    $newDateEdit = $dateInsert->add($interval);
			$document->setDateEdit($newDateEdit);
			$em->persist($document);
			$em->flush();

		    $ids[] = $document->getDocumentId();
		    $this->getEventManager()->trigger('classifiedCreated.post', $this, $event);
		}
		
		return $ids;
    }
public function activationEmailResend($limit = 10) 
    {
		$main = $this->getServiceLocator()->get('neobazaar.service.main');
		$em = $main->getEntityManager();
		$cache = $this->getServiceLocator()->get('ClassifiedCache');
		$documentRepository = $main->getDocumentEntityRepository();
		$documents = $documentRepository->getClassifiedsThatNeedActivationEmailToBeResent($limit); 
        $url = $this->getServiceLocator()->get('ControllerPluginManager')->get('Url');
        
		$ids = array();
		foreach ($documents as $document) {
		    $url = $this->getServiceLocator()->get('ControllerPluginManager')->get('Url');
		    $classifiedModel = $this->getServiceLocator()->get('document.model.classifiedAdminListing');
		    $classifiedModel->init($document, $this->getServiceLocator());
		    $event = new ClassifiedCreatedEvent('save', null, array(
    		    'to' => $classifiedModel->email, 
    		    'siteurl' => $url->fromRoute('home', array(), array('force_canonical' => true)),
    		    'fullname' => $classifiedModel->fullname,
		        'title' => $classifiedModel->title, 
		        'hash' => $classifiedModel->hashId,
		        'state' => $classifiedModel->state
    		));
            
		    // Add 1 second to date edit
		    $dateInsert = $document->getDateInsert();
		    $interval = new \DateInterval('PT1S'); // 1 second
		    $newDateEdit = $dateInsert->add($interval);
			$document->setDateEdit($newDateEdit);
			$em->persist($document);
			$em->flush();

		    $ids[] = $document->getDocumentId();
		    $this->getEventManager()->trigger('classifiedCreated.post', $this, $event);
		}
		
		return $ids;
    }
public function activationEmailResend ( $ limit = 10 ) { $ main = $ this -> getServiceLocator ( ) -> get ( 'neobazaar.service.main' ) ; $ em = $ main -> getEntityManager ( ) ; $ cache = $ this -> getServiceLocator ( ) -> get ( 'ClassifiedCache' ) ; $ documentRepository = $ main -> getDocumentEntityRepository ( ) ; $ documents = $ documentRepository -> getClassifiedsThatNeedActivationEmailToBeResent ( $ limit ) ; $ url = $ this -> getServiceLocator ( ) -> get ( 'ControllerPluginManager' ) -> get ( 'Url' ) ; $ ids = array ( ) ; foreach ( $ documents as $ document ) { $ url = $ this -> getServiceLocator ( ) -> get ( 'ControllerPluginManager' ) -> get ( 'Url' ) ; $ classifiedModel = $ this -> getServiceLocator ( ) -> get ( 'document.model.classifiedAdminListing' ) ; $ classifiedModel -> init ( $ document , $ this -> getServiceLocator ( ) ) ; $ event = new ClassifiedCreatedEvent ( 'save' , null , array ( 'to' => $ classifiedModel -> email , 'siteurl' => $ url -> fromRoute ( 'home' , array ( ) , array ( 'force_canonical' => true ) ) , 'fullname' => $ classifiedModel -> fullname , 'title' => $ classifiedModel -> title , 'hash' => $ classifiedModel -> hashId , 'state' => $ classifiedModel -> state ) ) ; // Add 1 second to date edit $ dateInsert = $ document -> getDateInsert ( ) ; $ interval = new \ DateInterval ( 'PT1S' ) ; // 1 second $ newDateEdit = $ dateInsert -> add ( $ interval ) ; $ document -> setDateEdit ( $ newDateEdit ) ; $ em -> persist ( $ document ) ; $ em -> flush ( ) ; $ ids [ ] = $ document -> getDocumentId ( ) ; $ this -> getEventManager ( ) -> trigger ( 'classifiedCreated.post' , $ this , $ event ) ; } return $ ids ; }
This service will trigger event with classifieds that needs activetion email to be resent.

@param int $limit
@return array with document ids
This service will trigger event with classifieds that needs activetion email to be resent .