$people = $hr->findAllPeople();
print_r($people);
foreach ($people as $person) {
    foreach ($person->phone_numbers as $number) {
        print $number . "\n";
    }
}
// Add a new person
// TODO: Add Address
$new_person = new HighrisePerson($hr);
$new_person->setFirstName("John Test");
$new_person->setLastName("Doe");
$new_person->setTitle("Nowhere Man");
$new_person->setBackground("Some background here");
$new_person->setCompanyName("Test Corp");
$new_person->addEmailAddress("*****@*****.**");
$new_person->addEmailAddress("*****@*****.**", "work");
$new_person->addPhoneNumber("+1 555-555-5555", "Work");
$new_person->addPhoneNumber("+1 555-555-1111", "Home");
$new_person->addTwitterAccount("johndoe");
$new_person->addTwitterAccount("johndoework", "Business");
$new_person->addWebAddress("http://john.wordpress.com", "Personal");
$new_person->addWebAddress("http://corporation.com/~john");
$new_person->addInstantMessenger("MSN", "*****@*****.**");
$new_person->addInstantMessenger("AIM", "*****@*****.**", "Work");
$new_person->save();
$new_person = null;
$people = $hr->findPeopleBySearchTerm("John Test Doe");
print count($people) . " matched search term John Test before deletion.\n";
foreach ($people as $person) {
    if ($person->getFirstName() != "John Test" || $person->getLastName() != "Doe" || $person->getTitle() != "Nowhere Man" || $person->getBackground() != "Some background here") {
示例#2
0
<?php

require_once "../lib/HighriseAPI.class.php";
if (count($argv) != 3) {
    die("Usage: php tags.test.php [account-name] [access-token]\n");
}
$highrise = new HighriseAPI();
$highrise->debug = false;
$highrise->setAccount($argv[1]);
$highrise->setToken($argv[2]);
$people = $highrise->findPeopleBySearchTerm("Personality Changer");
foreach ($people as $p) {
    $p->delete();
}
$person = new HighrisePerson($highrise);
$person->setFirstName("Personality");
$person->setLastName("Changer");
$person->addEmailAddress("*****@*****.**");
$person->save();
print "Person ID is: " . $person->getId() . "\n";
$person->addEmailAddress("*****@*****.**");
$person->save();
print "Person ID after save is: " . $person->getId() . "\n";
print_r($person);
$people = $highrise->findPeopleBySearchTerm("Personality Changer");
print_r($people);
$person->delete();