public function getWidgetProspects($identifier)
	{
	    // Event parameters prepare
	    $results = null;
	     
	    // Service implementation start
	    $prospectTable = $this->getServiceLocator()->get('MelisProspects');
	    switch($identifier){
	        case 'curMonth':
	            $results = $prospectTable->getCurrentMonth()->count(); break;
	        case 'avgMonth':
	            
	            $minDate = $prospectTable->getProspectsOrderByDate('ASC')->current();
	            $maxDate = $prospectTable->getProspectsOrderByDate('DESC')->current();
	            $minDate = ($minDate) ? strtotime($minDate->pros_contact_date) : 0;	           
	            $maxDate = ($maxDate) ? strtotime($maxDate->pros_contact_date) : 0;
	            $days = ceil(abs($minDate - time()) / 86400); // get days difference
	            $months = intval($days/30);      
	            $results = $prospectTable->getAvgMonth($months)->current(); break;
	        default:
	            break;
	    }
	    // Service implementation end
	     
	    return $results;
	}
public function getWidgetProspects($identifier)
	{
	    // Event parameters prepare
	    $results = null;
	     
	    // Service implementation start
	    $prospectTable = $this->getServiceLocator()->get('MelisProspects');
	    switch($identifier){
	        case 'curMonth':
	            $results = $prospectTable->getCurrentMonth()->count(); break;
	        case 'avgMonth':
	            
	            $minDate = $prospectTable->getProspectsOrderByDate('ASC')->current();
	            $maxDate = $prospectTable->getProspectsOrderByDate('DESC')->current();
	            $minDate = ($minDate) ? strtotime($minDate->pros_contact_date) : 0;	           
	            $maxDate = ($maxDate) ? strtotime($maxDate->pros_contact_date) : 0;
	            $days = ceil(abs($minDate - time()) / 86400); // get days difference
	            $months = intval($days/30);      
	            $results = $prospectTable->getAvgMonth($months)->current(); break;
	        default:
	            break;
	    }
	    // Service implementation end
	     
	    return $results;
	}
public function getWidgetProspects ( $ identifier ) { // Event parameters prepare $ results = null ; // Service implementation start $ prospectTable = $ this -> getServiceLocator ( ) -> get ( 'MelisProspects' ) ; switch ( $ identifier ) { case 'curMonth' : $ results = $ prospectTable -> getCurrentMonth ( ) -> count ( ) ; break ; case 'avgMonth' : $ minDate = $ prospectTable -> getProspectsOrderByDate ( 'ASC' ) -> current ( ) ; $ maxDate = $ prospectTable -> getProspectsOrderByDate ( 'DESC' ) -> current ( ) ; $ minDate = ( $ minDate ) ? strtotime ( $ minDate -> pros_contact_date ) : 0 ; $ maxDate = ( $ maxDate ) ? strtotime ( $ maxDate -> pros_contact_date ) : 0 ; $ days = ceil ( abs ( $ minDate - time ( ) ) / 86400 ) ; // get days difference $ months = intval ( $ days / 30 ) ; $ results = $ prospectTable -> getAvgMonth ( $ months ) -> current ( ) ; break ; default : break ; } // Service implementation end return $ results ; }
This method retrieves the data used for the list widget
@param varchar $identifier accepts curMonth|avgMonth
@return float|null , float on success, otherwise null
This method retrieves the data used for the list widget