Exemplo n.º 1
0
 public function getGoogleContacts($opts = array())
 {
     $gcontacts = ContactFactory::getAll();
     if (!empty($opts['sort'])) {
         usort($gcontacts, function ($contact1, $contact2) {
             return strtolower($contact1->name) < strtolower($contact2->name) ? -1 : 1;
         });
     }
     return $gcontacts;
 }
Exemplo n.º 2
0
<?php

require_once '../../../vendor/autoload.php';
use rapidweb\googlecontacts\factories\ContactFactory;
$contacts = ContactFactory::getAll();
if (count($contacts)) {
    echo 'Test retrieved ' . count($contacts) . ' contacts.';
} else {
    echo 'No contacts retrieved!';
}