PrebuildHandler

This class contains the functions to perform the following:

  • Retrieve Prebuild(s)
  • Insert Prebuild(s)
  • Update Prebuild(s)
api
package simPROAPI
subpackage Materials
author Nathan Muir
version 2011-07-18

 Methods

PrebuildInsert

Insert(int $CompanyID, array $PrebuildDetails) : int
Static
<?php
$PrebuildDetails = array(
    "PrebuildType"          => "Standard"|"SetPrice",
    "PrebuildGroupID"       => 0,
    "PrebuildSubGroupID"    => 0,
    "Name"                  => "",
    "PartNo"                => "",
    "Notes"                 => "",
    "MaterialCost"          => 0,
    "MaterialMarkup"        => 0,
    "EstimatedTime"         => 0,
    "LabourRateID"          => 0,
    "LabourMarkup"          => 0,
    "Price"                 => 0,
    "StockItems"            => array(0 => array("StockItemID" => 0, "Qty" => 0, "FitTimeID" => 0),
    "CustomFields"          => array(Name => Value)
);
?>

Parameters

$CompanyID

int

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

$PrebuildDetails

array

associate array of prebuild data

Returns

int

PrebuildRetrieve

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

This function retrieves details for a specific details id

uses \PrebuildHandler::RetrieveList()

Parameters

$CompanyID

int

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

$PrebuildID

int

the Prebuild Group id to retrieve details for

Returns

array

PrebuildRetrieveList

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

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

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

Parameters

$CompanyID

int

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

$PrebuildIDs

array

the Prebuild Item ids to retrieve details for

Returns

array

PrebuildSearchExact

SearchExact(int $CompanyID, string $Search, int $PrebuildGroupID = null, int $PrebuildSubGroupID = null) : array
Static

This function searches the prebuild for item which matches exactly the name or part no

uses \PrebuildHandler::RetrieveList()

Parameters

$CompanyID

int

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

$Search

string

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

$PrebuildGroupID = null

int

the prebuild group to search in

$PrebuildSubGroupID = null

int

the sub group to search in

Returns

array