AssetHandler
This class contains the functions to perform the following:
Retrieve:
api | |
---|---|
package | simPROAPI |
subpackage | Asset |
author | Nathan Muir |
version | 2011-07-18 |
todo | all permission checks require editasset, may want to allow lower perms |
Insert(int $CompanyID, array $AssetDetails) : int
<?php
$AssetDetails = array(
"AssetTypeID"=>0,
"SiteID"=>0,
"WalkOrder"=>0,
"ContractID"=>0,
"StartDate"=>"Y-m-d",
"AssetFields"=>array(
array("FieldID"=>0,"FieldValue"=>""),
array("FieldID"=>0,"FieldValue"=>""),
),
"ServiceLevels"=>array(
array("ServiceLevelID"=>0,"ServiceDate"=>"Y-m-d"),
array("ServiceLevelID"=>0,"ServiceDate"=>"Y-m-d"),
),
"ParentAssetID"=>0
);
?>
int
the Company ID. In single company builds, this is 0.
array
an associative array of Asset information.
int
Retrieve(int $CompanyID, int $AssetID) : array
uses | \AssetHandler::RetrieveList() |
---|
int
the Company ID. In single company builds, this is 0.
int
an asset to retrieve
array
RetrieveList(int $CompanyID, array $AssetIDs) : array
used_by | \AssetHandler::SearchExact() |
---|---|
used_by | \AssetHandler::Retrieve() |
int
In single company builds, this is 0.
array
list of Asset ID's to retrieve details for
array
SearchExact(int $CompanyID, string $Search = null, string $FieldName = null, int $AssetTypeID = null, int $SiteID = null) : array
This function searches assets which match exactly the value of any or a given asset custom field value
uses | \AssetHandler::RetrieveList() |
---|
int
the Company ID. In single company builds, this is 0.
string
the text to match the asset custom field value
string
the name the asset custom field to match. Use null to ignore this
int
the type id of the asset to match. Use null to ignore this
int
the site id of the asset to match. Use null to ignore this
array
ServiceLevelRetrieve(int $CompanyID, int $AssetTypeID = null) : array
contribution | Isaac Martin 20121-09-05 |
---|---|
contribution | Isaac Martin 20121-02-15 |
int
the Company ID. In single company builds, this is 0.
int
the Asset Type ID (Optional)
array
TestRecordInsert(int $CompanyID, array $TestRecord) : array
<?php
array_keys($TestRecord) =
array(
'EmployeeID',
'Date',
'ProjectID',
'ProjectType', // 0 for Job, 1 for Quote
'SectionCostCentreID',
'Notes',
'Assets' =>
array(
array(
'AssetID',
'ServiceLevelID', // Optional
'TestResult', // -1 for No Test, 0 for Fail, 1 for Pass
'FailurePoints' =>
array( // Optional
array(
'FailurePointID',
'Recommendations' =>
array(
array(
'RecommendationID'
)
)
)
)
)
)
)
int
the Company ID. In single company builds, this is 0.
array
an associate array of test record details
array
TypeRetrieve(int $CompanyID) : array
contribution | Isaac Martin 2012-05-09 |
---|---|
contribution | Isaac Martin 2012-02-14 |
int
the Company ID. In single company builds, this is 0.
array
Update(int $CompanyID, int $AssetID, array $AssetDetails) : bool
<?php
$AssetDetails = array(
"SiteID"=>0,
"WalkOrder"=>0,
"ContractID"=>0,
"StartDate"=>"Y-m-d",
"AssetFields"=>array(
array("FieldID"=>0,"FieldValue"=>""),
array("FieldID"=>0,"FieldValue"=>""),
),
"ServiceLevels"=>array(
array("ServiceLevelID"=>0,"ServiceDate"=>"Y-m-d"),
array("ServiceLevelID"=>0,"ServiceDate"=>"Y-m-d"),
),
"ParentAssetID"=>0
);
?>
int
the Company ID. In single company builds, this is 0.
int
The Asset ID to update with the supplied information.
array
an associative array of Asset information.
bool