SiteHandler

This class contains the functions to perform the following:

  • Retrieve Site(s)
  • Insert Site(s)
  • Update Site(s)

api
package simPROAPI
subpackage Sites
author Nathan Muir
version 2011-07-18

 Methods

SiteContactInsert

ContactInsert(int $CompanyID, int $SiteID, array $SiteContactDetails) : bool
Static
<?php
array_keys($SiteContactDetails) == array(
                            "FirstName",
                            "LastName",
                            "Position",
                            "PhoneNumber",
                            "Mobile",
                            "Fax",
                            "Email"
                            );
?>

Parameters

$CompanyID

int

the company id

$SiteID

int

the site to add the contact to.

$SiteContactDetails

array

an associative array of site contacts' information.

Returns

bool

SiteContactRetrieve

ContactRetrieve(int $CompanyID, int $SiteID, int $ContactID = null) : array
Static
uses \SiteHandler::ContactRetrieveList()

Parameters

$CompanyID

int

the Company ID. In single company builds, this is 0.

$SiteID

int

the site id, to retrieve Site Contacts for

$ContactID = null

int

the Contact ID.

Returns

array

SiteContactRetrieveList

ContactRetrieveList(int $CompanyID, array $SiteIDs) : array
Static
used_by \SiteHandler::ContactRetrieve()

Parameters

$CompanyID

int

the Company ID. In single company builds, this is 0.

$SiteIDs

array

list of Site ID's to retrieve Site Contacts for

Returns

array

SiteInsert

Insert(int $CompanyID, array $SiteDetails) : int
Static
<?php
array_keys($SiteDetails) == array (
'SiteName',
'Address',
'Suburb',
'State',
'Postcode',
'Country',
'MailAddress',
'MailSuburb',
'MailState',
'MailPostcode',
'ContactFirstName',
'ContactLastName',
'ContactPosition',
'Phone',
'Mobile',
'Fax',
'Email',
'Notes',
'ZoneName',
'ZoneID',
'CertificationDay',
'CertificationMonth',
'PostalContact',
'MailCompanyInclude',
'CustomFields'
);
?>

Parameters

$CompanyID

int

the company id

$SiteDetails

array

an associative array of site information.

Returns

int

SitePreferredTechnician

PreferredTechnician(int $CompanyID, int $SiteID) : array
Static

Parameters

$CompanyID

int

the Company ID. In single company builds, this is 0.

$SiteID

int

retrieve details for the specified id

Returns

array

SiteRetrieve

Retrieve(int $CompanyID, int $SiteID) : array
Static
uses \SiteHandler::RetrieveList()

Parameters

$CompanyID

int

the Company ID. In single company builds, this is 0.

$SiteID

int

retrieve details for the specified id

Returns

array

SiteRetrieveList

RetrieveList(int $CompanyID, array $SiteIDs) : array
Static
used_by \CustomerHandler::SiteRetrieveList()
used_by \SiteHandler::Search()
used_by \SiteHandler::SearchFields()
used_by \SiteHandler::Retrieve()

Parameters

$CompanyID

int

the Company ID. In single company builds, this is 0.

$SiteIDs

array

list of Site ID's to retrieve details for

Returns

array

SiteSearchFields

SearchFields(int $CompanyID, array $SearchTerms) : array
Static

This function retrieve's a list of sites who's set of fields match their associated values

Implemented Search Terms are: Address,Suburb,State,Postcode,Zone,ZoneName

uses \SiteHandler::RetrieveList()

Parameters

$CompanyID

int

the Company ID. In single company builds, this is 0.

$SearchTerms

array

An associative array of Search Fields[key] and their search terms [value]

Returns

array

SiteUpdate

Update(int $CompanyID, int $SiteID, array $SiteDetails) : bool
Static
<?php
array_keys($SiteDetails) == array (
'SiteName',
'Address',
'Suburb',
'State',
'Postcode',
'Country',
'MailAddress',
'MailSuburb',
'MailState',
'MailPostcode',
'ContactFirstName',
'ContactLastName',
'ContactPosition',
'Phone',
'Mobile',
'Fax',
'Email',
'Notes',
'ZoneName',
'ZoneID',
'CertificationDay',
'CertificationMonth',
'MailContact',
'MailCompanyInclude',
'CustomFields'
);
?>

Parameters

$CompanyID

int

the company id

$SiteID

int

The site to update.

$SiteDetails

array

an associative array of site information.

Returns

bool

SiteValueForecast

ValueForecast(int $CompanyID, int $SiteID, string $StartDate, string $EndDate) : array
StaticNot Implemented

Performs a value forecast on a site.

Parameters

$CompanyID

int

the company id

$SiteID

int

the site to perform the Value Forcast for

$StartDate

string

Date start (inclusive) to search. {@link http://php.net/manual/en/function.strtotime.php}

$EndDate

string

Date end (inclusive) to search. {@link http://php.net/manual/en/function.strtotime.php}

Returns

array