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

 Methods

CatalogItemAddSupplier

AddSupplier(int $CompanyID, int $CatalogItemID, int $SupplierID, double $NettPrice = null, bool $Default = false) : bool
Static

Parameters

$CompanyID

int

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

$CatalogItemID

int

The catalog item id to update

$SupplierID

int

The supplier id to attach to the catalog item

$NettPrice = null

double

Nett price for this part and supplier (Optional)

$Default = false

bool

Set this supplier as the item's default supplier (Default: false)

Returns

bool

CatalogItemDeleteSupplier

DeleteSupplier(int $CompanyID, int $CatalogItemID, int $SupplierID) : bool
Static

Parameters

$CompanyID

int

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

$CatalogItemID

int

The catalog item id to update

$SupplierID

int

The supplier id to remove from the catalog item

Returns

bool

CatalogItemInsert

Insert(int $CompanyID, array $CatalogItemDetails) : int
Static
<?php
$CatalogItemDetails = array(
   "ItemName"=>"",
   "GroupID"=>0,
   "SubGroupID"=>0,
   "PartNo"=>"",
   "TradePrice"=>0.00,
   "Manufacturer"=>"",
   "Notes"=>"",
   "Time"=>0.00,
   "SearchTerms"=>array("",""),
   "Favourite"=>true
   );
?>

Parameters

$CompanyID

int

the company id

$CatalogItemDetails

array

an associative array of task information.

Returns

int

CatalogItemRetrieve

Retrieve(int $CompanyID, int $CatalogItemID) : array
Static

This function retrieves details for a specific details id

uses \CatalogItemHandler::RetrieveList()

Parameters

$CompanyID

int

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

$CatalogItemID

int

the Catalog Group id to retrieve details for

Returns

array

CatalogItemRetrieveList

RetrieveList(int $CompanyID, array $CatalogItemIDs) : array
Static

This function retrieves details on the provided list of Catalog Item ids

used_by \CatalogItemHandler::Search()
used_by \CatalogItemHandler::SearchExact()
used_by \CatalogItemHandler::Retrieve()

Parameters

$CompanyID

int

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

$CatalogItemIDs

array

the Catalog Item ids to retrieve details for

Returns

array

CatalogItemSearchExact

SearchExact(int $CompanyID, string $Search, int $CatalogGroupID = null, int $CatalogSubGroupID = null) : array
Static

This function searches the catalog for item which matches exactly the name, catalog no, or search terms

uses \CatalogItemHandler::RetrieveList()

Parameters

$CompanyID

int

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

$Search

string

the text to match the name, catalog no, or search terms for

$CatalogGroupID = null

int

the catalog group to search in

$CatalogSubGroupID = null

int

the sub group to search in

Returns

array

CatalogItemUpdate

Update(int $CompanyID, int $CatalogItemID, array $CatalogItemDetails) : bool
Static
<?php
$CatalogItemDetails = array(
   "ItemName"=>"",
   "GroupID"=>0,
   "SubGroupID"=>0,
   "PartNo"=>"",
   "TradePrice"=>0.00,
   "Manufacturer"=>"",
   "Notes"=>"",
   "Time"=>0.00,
   "SearchTerms"=>array("",""),
   "Favourite"=>true
   );
?>

Parameters

$CompanyID

int

the company id

$CatalogItemID

int

The item id to update with the supplied information

$CatalogItemDetails

array

an associative array of task information.

Returns

bool