public function getLeads($startDate, $endDate, array $params = array())
    {
        $isValidStartDate = $this->utils->isSystemDatetime($startDate);
        $isValidEndDate = $this->utils->isSystemDatetime($endDate);
        if (!$isValidEndDate || !$isValidStartDate) {
            throw new InvalidArgumentException('Invalid params: Only system date has available YYYY-MM-DDD HH:II:SS');
        }

        if ($startDate > $endDate) {
            throw new InvalidArgumentException('Invalid params: start_date > end_date');
        }

        $isOutOfLimit = $this->utils->isOutOfLimit($startDate, $endDate, LeadAcademic::LIMIT_PERIOD);
        if ($isOutOfLimit) {
            throw new InvalidArgumentException('Invalid params: Period is too large. Available only ' . LeadAcademic::LIMIT_PERIOD);
        }

        $params['date_lbound'] = $startDate;
        $params['date_ubound'] = $endDate;

        $this->normalizeParams($params);
        $response = $this->execute('/', $params);
        $data = $this->normalize($response);
        return $data['leads'];
    }
public function getLeads($startDate, $endDate, array $params = array())
    {
        $isValidStartDate = $this->utils->isSystemDatetime($startDate);
        $isValidEndDate = $this->utils->isSystemDatetime($endDate);
        if (!$isValidEndDate || !$isValidStartDate) {
            throw new InvalidArgumentException('Invalid params: Only system date has available YYYY-MM-DDD HH:II:SS');
        }

        if ($startDate > $endDate) {
            throw new InvalidArgumentException('Invalid params: start_date > end_date');
        }

        $isOutOfLimit = $this->utils->isOutOfLimit($startDate, $endDate, LeadAcademic::LIMIT_PERIOD);
        if ($isOutOfLimit) {
            throw new InvalidArgumentException('Invalid params: Period is too large. Available only ' . LeadAcademic::LIMIT_PERIOD);
        }

        $params['date_lbound'] = $startDate;
        $params['date_ubound'] = $endDate;

        $this->normalizeParams($params);
        $response = $this->execute('/', $params);
        $data = $this->normalize($response);
        return $data['leads'];
    }
public function getLeads ( $ startDate , $ endDate , array $ params = array ( ) ) { $ isValidStartDate = $ this -> utils -> isSystemDatetime ( $ startDate ) ; $ isValidEndDate = $ this -> utils -> isSystemDatetime ( $ endDate ) ; if ( ! $ isValidEndDate || ! $ isValidStartDate ) { throw new InvalidArgumentException ( 'Invalid params: Only system date has available YYYY-MM-DDD HH:II:SS' ) ; } if ( $ startDate > $ endDate ) { throw new InvalidArgumentException ( 'Invalid params: start_date > end_date' ) ; } $ isOutOfLimit = $ this -> utils -> isOutOfLimit ( $ startDate , $ endDate , LeadAcademic :: LIMIT_PERIOD ) ; if ( $ isOutOfLimit ) { throw new InvalidArgumentException ( 'Invalid params: Period is too large. Available only ' . LeadAcademic :: LIMIT_PERIOD ) ; } $ params [ 'date_lbound' ] = $ startDate ; $ params [ 'date_ubound' ] = $ endDate ; $ this -> normalizeParams ( $ params ) ; $ response = $ this -> execute ( '/' , $ params ) ; $ data = $ this -> normalize ( $ response ) ; return $ data [ 'leads' ] ; }
Get leads from specific period
@param $startDate
@param $endDate
@param $params array
@return array
@throws InvalidArgumentException
Get leads from specific period