# pclass_api
The pclass API contains all API methods for creating new and retrieving existing property class data.
Methods: pclass__
create($data) - Used to create a new property class.
create(array $data) : array
Returns: (array)
['error'] - TRUE/FALSE - Error status of the creation request
['error_msg'] - TEXT - Error message returned (if ['error'] = TRUE).
['class_id'] - INT - Numeric pclass ID# assigned to the new class
Parameters:
$data (array)
Expects an array containing the following array keys:
$data['class_system_name'] - The Name of the Property Class
$data['class_rank'] - Rank that Class should be displayed in
$data['field_id'] - Optional Array or Field IDs that should be assigned to this property class on creation. If used this MUST be an array.
<?php
//Create a new property class named Residential Property
// and set its rank to 1 using the 'pclass__create' API function
$result = $api->load_local_api('pclass__create', array(
'class_system_name'=>'Residential Property',
'class_rank'=>1
));
// format and output the contents of the $result array so the keys
// and values can be seen.
echo '<pre>';
print_r($result);
echo '</pre>';
?>
read($data) - Used to read detailed information from a single property class.
read(array $data) : array
Returns: (array)
['error'] - TRUE/FALSE - Error status of the read request
['error_msg'] - TEXT - Error message returned (if ['error'] = TRUE).
['class_id'] - INT - Numeric class ID#
['class_name'] - TEXT - The name of the Property Class
['class_rank'] - INT - The numeric rank of the Property Class
Parameters:
$data (array)
Expects an array containing the following array keys:
$data['class_id'] - The ID of the property class to return information from.
metadata($data) - Used to get information on ALL property classes.
metadata(array $data) : array
Returns: (array)
['error'] - TRUE/FALSE - Error status of the read request
['error_msg'] - TEXT - Error message returned (if ['error'] = TRUE).
['metadata'] - ARRAY - multi dimensional array where they key is the property class ID#.
['metadata'][PCLASSID']['name'] - TEXT - The name of the Property Class
['metadata'][PCLASSID']['rank'] - INT - The numeric rank of the Property Class
Parameters:
$data (array)
Expects an empty array: array()
example:
<?php
$result = $api->load_local_api('pclass__metadata',array());
?>
← page_api twitter_api →