PHP code example of libcast / highrise

1. Go to this page and download the library: Download libcast/highrise library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

libcast / highrise example snippets


use Highrise\Resources\HighrisePerson;

$person = new HighrisePerson($highrise);
$person->setFirstName("John");
$person->setLastName("Doe");
$person->addEmailAddress("[email protected]");

$address = new HighriseAddress();
$address->setAddress("165 Test St.");
$address->setCity("Glasgow");
$address->setCountry("Scotland");
$address->setZip("GL1");
$person->addAddress($address);

$person->save();

$people = $highrise->findPeopleBySearchTerm("John");
foreach($people as $p) {
    print $person->getFirstName() . "\n";
}

foreach($highrise->findAllPeople() as $person) {
    print_r($person->getNotes());
}

$note = new HighriseNote($highrise);
$note->setSubjectType("Party");
$note->setSubjectId($person->getId());
$note->setBody("Test");
$note->save();

$people = $highrise->findPeopleByTitle("CEO");
foreach($people as $person) {
    $person->addTag("CEO");
    $person->save();
}

$people = $highrise->findPeopleByTitle("Ex-CEO");
foreach($people as $person) {
    unset($person->tags['CEO']);
    $person->save();
}

$all_tags = $highrise->findAllTags();
print_r($all_tags);

$task = new HighriseTask($highrise);
$task->setBody("Task Body");
$task->setPublic(false);
$task->setFrame("Tomorrow");
$task->save();

$users = $highrise->findAllUsers();
$user = $users[0]; // just select the first user

foreach($highrise->findUpcomingTasks() as $task) {
    $task->assignToUser($user);
    $task->save();
}

$assigned_tasks = $highrise->findAssignedTasks();
print_r($assigned_tasks);

$users = $highrise->findAllUsers();
print_r($users);

$me = $highrise->findMe();