private function getMailChimpLists()
    {
        $lists = [];

        // If Milchimp class doesn't exist or no key is set return empty list.
        if (!class_exists(\DrewM\MailChimp\MailChimp::class) || !$this->apiKey) {
            return $lists;
        }

        $mailChimp = new \DrewM\MailChimp\MailChimp($this->apiKey);
        $response = $mailChimp->get('lists', ['count' => 100]);

        if (!isset($response['lists'])) {
            return $lists;
        }

        foreach ($response['lists'] as $list) {
            $lists[] = [
                'id' => $list['id'],
                'name' => $list['name'],
            ];
        }

        return $lists;
    }
private function getMailChimpLists()
    {
        $lists = [];

        // If Milchimp class doesn't exist or no key is set return empty list.
        if (!class_exists(\DrewM\MailChimp\MailChimp::class) || !$this->apiKey) {
            return $lists;
        }

        $mailChimp = new \DrewM\MailChimp\MailChimp($this->apiKey);
        $response = $mailChimp->get('lists', ['count' => 100]);

        if (!isset($response['lists'])) {
            return $lists;
        }

        foreach ($response['lists'] as $list) {
            $lists[] = [
                'id' => $list['id'],
                'name' => $list['name'],
            ];
        }

        return $lists;
    }
private function getMailChimpLists ( ) { $ lists = [ ] ; // If Milchimp class doesn't exist or no key is set return empty list. if ( ! class_exists ( \ DrewM \ MailChimp \ MailChimp :: class ) || ! $ this -> apiKey ) { return $ lists ; } $ mailChimp = new \ DrewM \ MailChimp \ MailChimp ( $ this -> apiKey ) ; $ response = $ mailChimp -> get ( 'lists' , [ 'count' => 100 ] ) ; if ( ! isset ( $ response [ 'lists' ] ) ) { return $ lists ; } foreach ( $ response [ 'lists' ] as $ list ) { $ lists [ ] = [ 'id' => $ list [ 'id' ] , 'name' => $ list [ 'name' ] , ] ; } return $ lists ; }
Returns array of Mailchimp lists of given account defined by the API key.

@return array
Returns array of Mailchimp lists of given account defined by the API key .