This method will get Prospect Data

@param string $type, this will determine what type of request
@param string $date, if specified this will return only from the date to the current date
@return number
766307
public function getProspectsDataByDate($type = 'daily', $date){
	    
	    $prospectsTable = $this->getServiceLocator()->get('MelisProspects');
	    $dataProspects = $prospectsTable->getProspectsOrderByDate('DESC');
	
	    // Set Number of Prospect to Zero as default Value
	    $nb = 0;
	
	    if (!empty($dataProspects)){
	
	        $res = $dataProspects->toArray();
	
	        if (!empty($res)){
	
	            switch ($type) {
	                case 'daily':
	                    for ($i = 0 ; $i < count($res); $i++){
	                        // Checking if Date is same as the Param data
	                        if ($date==date('Y-m-d',strtotime($res[$i]['pros_contact_date']))){
	                            $nb++;
	                        }
	                    }
	                    break;
	                case 'monthly':
	                    for ($i = 0 ; $i < count($res); $i++){
	                        // Checking if Date is same as the Param data
	                        if (date('Y-m',strtotime($date))==date('Y-m',strtotime($res[$i]['pros_contact_date']))){
	                            $nb++;
	                        }
	                    }
	                    break;
	                case 'yearly':
	                    for ($i = 0 ; $i < count($res); $i++){
	                        // Checking if Date is same as the Param data
	                        if (date('Y',strtotime($date))==date('Y',strtotime($res[$i]['pros_contact_date']))){
	                            $nb++;
	                        }
	                    }
	                    break;
	                default:
	                    break;
	            }
	        }
	    }
	
	    return $nb;
	
	}
129906
public function max($date = null)
    {
        $date = $this->resolveCarbon($date);

        return $this->gt($date) ? $this : $date;
    }
327031
private function _datePad($date, $type = 'year')
    {
        $padLength = $type == 'year' ? 4 : 2;
        $newDate = str_pad($date, $padLength, '0', STR_PAD_LEFT);

        return $newDate;
    }
1285164
public static function formatFromConfig($type, $date) {
        $ini = Zend_Registry::get('config');
        $format = $ini->date->format->$type;

        if (strpos($format, '%') !== false) {
            return strftime($format, strtotime($date));
        } else {
            return date($format, strtotime($date));
        }
    }
420030
public static function is($date)
    {
        if (is_bool($date) || empty($date) xor ($date === 0 || $date === '0')) {
            return false;
        }
        $date = static::isTimestamp($date) ? '@' . (string)$date : $date;
        return (bool)date_create($date);
    }
331439
private function getLogOrFail($date)
    {
        try {
            return app(LogViewer::class)->get($date);
        } catch (LogNotFound $e) {
            return abort(404, $e->getMessage());
        }
    }
117265
public function get($type, $key)
    {
        if (array_key_exists($key, self::$store)) {
            //TODO: implement expiration check
            // implement data type check?
            return self::$store[$key]['value'];
        }
        return null;
    }
323899
public function getDate($date = null, $format = 'Y-m-d H:i:s')
    {
        if (strlen($date) < 0) {
            $date = date('d-m-Y H:i:s');
        }

        $timeStamp = new DateTime($date);
        return $timeStamp->format($format);
    }
946131
public static function shortDate($date)
    {
        if (self::isDate($date)) {
            $str = self::dateTimeToTimeStamp($date);
            $string = date("d.m.Y", $str);
            return $string;
        } else {
            return null;
        }
    }
36267
public function fetch($type = parent::FETCH_TYPE_NUM)
    {
        $callback = $this->_callback;
        $row = $this->_statement->fetch($type);

        return $row === false ? $row : $callback($row);
    }
237060
final public static function asSql($date)
    {
        if (!empty($date)) {
            if ($date instanceof \DateTimeInterface) {
                return $date->format('Y-m-d H:i:sO');
            } else {
                return self::asDateTime($date)->format('Y-m-d H:i:sO');
            }
        } else {
            return null;
        }
    }
447306
private function getFromData($type, $key)
    {
        return $this->hasData($type, $key) ? $this->data[$type][$key] : null;
    }
163346
protected static function prepareDate($date)
    {
        if (null === $date) {
            return null;
        }
        if ($date instanceof DateTime) {
            return static::timeToString($date->getTimestamp());
        } elseif (is_numeric($date)) {
            return static::timeToString($date);
        } elseif (is_array($date)) {
            return @$date['date'];
        } elseif (self::hasTimestamp($date)) {
            return static::timeToString($date->getTimestamp());
        } elseif (is_string($date)) {
            return false !== strtotime($date) ? $date : null;
        }

        return null;
    }
571953
public static function instance($date)
    {
        if ($date instanceof static) {
            return clone $date;
        }

        static::expectDateTime($date);

        return new static($date->format('Y-m-d H:i:s.u'), $date->getTimezone());
    }
836486
public function evaluateExclusions($date = null)
    {
        if (!$date) {
            $date = clone $this->now;
        }
        // Check dates of exclusion (if there are any).
        $jsonHelper       = new JSONHelper();
        $exclusionsString = $this->contactClient->getScheduleExclusions();
        $exclusions       = $jsonHelper->decodeArray($exclusionsString, 'ScheduleExclusions');
        if ($exclusions) {
            // Fastest way to compare dates is by string.
            $todaysDateString = $date->format('Y-m-d');
            foreach ($exclusions as $exclusion) {
                if (!empty($exclusion->value)) {
                    $dateString   = trim(str_ireplace('yyyy-', '', $exclusion->value));
                    $segments     = explode('-', $dateString);
                    $segmentCount = count($segments);
                    if (3 == $segmentCount) {
                        $year  = !empty($segments[0]) ? str_pad(
                            $segments[0],
                            4,
                            '0',
                            STR_PAD_LEFT
                        ) : $date->format(
                            'Y'
                        );
                        $month = !empty($segments[1]) ? str_pad(
                            $segments[1],
                            2,
                            '0',
                            STR_PAD_LEFT
                        ) : $date->format('m');
                        $day   = !empty($segments[2]) ? str_pad(
                            $segments[2],
                            2,
                            '0',
                            STR_PAD_LEFT
                        ) : $date->format('d');
                    } elseif (2 == $segmentCount) {
                        $year  = $date->format('Y');
                        $month = !empty($segments[0]) ? str_pad(
                            $segments[0],
                            2,
                            '0',
                            STR_PAD_LEFT
                        ) : $date->format('m');
                        $day   = !empty($segments[1]) ? str_pad(
                            $segments[1],
                            2,
                            '0',
                            STR_PAD_LEFT
                        ) : $date->format('d');
                    } else {
                        continue;
                    }
                    $dateString = $year.'-'.$month.'-'.$day;
                    if ($dateString == $todaysDateString) {
                        throw new ContactClientException(
                            'This contact client does not allow contacts on the date '.$dateString.'.',
                            0,
                            null,
                            Stat::TYPE_SCHEDULE,
                            false
                        );
                    }
                }
            }
        }

        return $this;
    }
1346450
public function textualDateFilter($date)
    {
        if ( ! $date instanceof \DateTime) {
            throw new \InvalidArgumentException('Textual Date Filter expects input to be a instance of DateTime');
        }

        $now  = new \DateTime('now');
        $diff = $now->diff($date);

        $diffUnit          = $this->getHighestDiffUnitAndValue($diff);
        $temporalModifier  = ($diff->invert)? 'ago':'next';
        $translationString = $temporalModifier. '.' .$diffUnit['unit'];

        // Override yesterday and tomorrow
        if ($diffUnit['unit'] == 'd' && $diffUnit['value'] == 1) {
            $translationString = ($diff->invert)? 'date.yesterday':'date.tomorrow';
        }

        // Override "just.now"
        if ($diffUnit['unit'] == 'now') {
            $translationString = 'date.just_now';
        }

        return $this->translator->transChoice($translationString, $diffUnit['value'], array('%value%' => $diffUnit['value']), 'date');
    }
216466
protected function resolveCarbon($date = null)
    {
        if (!$date) {
            return $this->nowWithSameTz();
        }

        if (is_string($date)) {
            return static::parse($date, $this->getTimezone());
        }

        static::expectDateTime($date, ['null', 'string']);

        return $date instanceof self ? $date : static::instance($date);
    }