You are here

function _mailchimp_list_cmp in Mailchimp 8

Same name and namespace in other branches
  1. 7.5 mailchimp.module \_mailchimp_list_cmp()
  2. 7.2 mailchimp.module \_mailchimp_list_cmp()
  3. 7.3 mailchimp.module \_mailchimp_list_cmp()
  4. 7.4 mailchimp.module \_mailchimp_list_cmp()
  5. 2.x mailchimp.module \_mailchimp_list_cmp()

Helper function used by uasort() to sort lists alphabetically by name.

Parameters

object $a: An object representing the first list.

object $b: An object representing the second list.

Return value

int One of the values -1, 0, 1

1 string reference to '_mailchimp_list_cmp'
mailchimp_get_lists in ./mailchimp.module
Returns all Mailchimp lists for a given key. Lists are stored in the cache.

File

./mailchimp.module, line 224
Mailchimp module.

Code

function _mailchimp_list_cmp($a, $b) {
  if ($a->name == $b->name) {
    return 0;
  }
  return $a->name < $b->name ? -1 : 1;
}