CatalogItemHandler
This class contains the functions to perform the following:
- Retrieve Catalog Items
- Insert Catalog Items
api | |
---|---|
package | simPROAPI |
subpackage | Materials |
author | Nathan Muir |
version | 2011-07-18 |
AddSupplier(int $CompanyID, int $CatalogItemID, int $SupplierID, double $NettPrice = null, bool $Default = false) : bool
int
the Company ID. In single company builds, this is 0.
int
The catalog item id to update
int
The supplier id to attach to the catalog item
double
Nett price for this part and supplier (Optional)
bool
Set this supplier as the item's default supplier (Default: false)
bool
DeleteLink(int $CompanyID, int $CatalogItemID, int $LinkCatalogItemID) : bool
int
the Company ID. In single company builds, this is 0.
int
The catalog item id to update by unlinking the supplied item
int
The catalog item id to unlink
bool
DeleteSupplier(int $CompanyID, int $CatalogItemID, int $SupplierID) : bool
int
the Company ID. In single company builds, this is 0.
int
The catalog item id to update
int
The supplier id to remove from the catalog item
bool
Insert(int $CompanyID, array $CatalogItemDetails) : int
<?php
$CatalogItemDetails = array(
"ItemName"=>"",
"GroupID"=>0,
"SubGroupID"=>0,
"PartNo"=>"",
"TradePrice"=>0.00,
"Manufacturer"=>"",
"Notes"=>"",
"Time"=>0.00,
"SearchTerms"=>array("",""),
"Favourite"=>true
);
?>
int
the company id
array
an associative array of task information.
int
Link(int $CompanyID, int $CatalogItemID, int $LinkCatalogItemID) : bool
int
the Company ID. In single company builds, this is 0.
int
The catalog item id to update with the supplied linked item
int
The catalog item id to link
bool
Retrieve(int $CompanyID, int $CatalogItemID) : array
This function retrieves details for a specific details id
uses | \CatalogItemHandler::RetrieveList() |
---|
int
the Company ID. In single company builds, this is 0.
int
the Catalog Group id to retrieve details for
array
RetrieveList(int $CompanyID, array $CatalogItemIDs) : array
This function retrieves details on the provided list of Catalog Item ids
used_by | \CatalogItemHandler::Search() |
---|---|
used_by | \CatalogItemHandler::SearchExact() |
used_by | \CatalogItemHandler::Retrieve() |
int
the Company ID. In single company builds, this is 0.
array
the Catalog Item ids to retrieve details for
array
Search(int $CompanyID, string $SearchText = null, int $CatalogGroupID = null, int $CatalogSubGroupID = null, int $Limit = 1000, int $Offset = 0, bool $Favorite = null) : array
This function searches the catalog for item with a name. Use % for wildcards
uses | \CatalogItemHandler::RetrieveList() |
---|
int
the Company ID. In single company builds, this is 0.
string
the text to search the name, catalog no, or search terms for
int
the catalog group to search in
int
the sub group to search in
int
how many results to return
int
how many results to skip, before returning {@link $Limit}
bool
return favorite items
array
SearchExact(int $CompanyID, string $Search, int $CatalogGroupID = null, int $CatalogSubGroupID = null) : array
This function searches the catalog for item which matches exactly the name, catalog no, or search terms
uses | \CatalogItemHandler::RetrieveList() |
---|
int
the Company ID. In single company builds, this is 0.
string
the text to match the name, catalog no, or search terms for
int
the catalog group to search in
int
the sub group to search in
array
Update(int $CompanyID, int $CatalogItemID, array $CatalogItemDetails) : bool
<?php
$CatalogItemDetails = array(
"ItemName"=>"",
"GroupID"=>0,
"SubGroupID"=>0,
"PartNo"=>"",
"TradePrice"=>0.00,
"Manufacturer"=>"",
"Notes"=>"",
"Time"=>0.00,
"SearchTerms"=>array("",""),
"Favourite"=>true
);
?>
int
the company id
int
The item id to update with the supplied information
array
an associative array of task information.
bool