CORE POS - IS4C
The CORE POS front end
Public Member Functions | Static Public Member Functions | List of all members
Parser Class Reference
Inheritance diagram for Parser:
AccessProgramParser AnnualMeetingParser AutoTare BalanceCheck CaseDiscMsgs CashDropParser CheckKey Clear ClubCard Comment CoopCredCheck CoopCredCheckQ DefaultTender DeptKey DiscountApplied DonationKey EndOfShift ItemPD LineItemDiscount Lock MemberID MiscLoggingParser NeedDiscountParser PartialReceipt paycardEntered PaycardSteering PriceCheckParser QuickKeyLauncher QuickMenuLauncher RRR ScaleInput ScrollItems SigTermCommands StackableDiscount Steering TaxFoodShift TenderKey TenderKeyCoopCred TenderOut ToggleReceipt Totals UPC VirtualCouponParser Void Wakeup WedgeScParser WfcMadCouponParser

Public Member Functions

 check ($str)
 
 parse ($str)
 
 default_json ()
 
 isLast ()
 
 isFirst ()
 
 doc ()
 

Static Public Member Functions

static get_parse_chain ()
 

Detailed Description

The base module for parsing input

Enabled Parser modules are checked until one matches the input. Input processing ceases and the matching module must decide what to do next.

Examples:
HW_Parser.php.

Member Function Documentation

Parser::check (   $str)

Check whether the module handles this input

Parameters
$strThe input string
Returns
  • True The module handles this input. The parse method() will be called next.
  • False The module does not handle this input. The parse method() will not be called and processing will proceed to the next Parser module.
Examples:
HW_Parser.php.
Parser::default_json ( )

A return array for parse() with proper keys

Returns
array

See parse() method

Examples:
HW_Parser.php.
Parser::doc ( )

Display documentation

Returns
A string describing the module

Ideally you should note what your module it does and what the input format is.

static Parser::get_parse_chain ( )
static

Gather parse modules

Returns
array of Parser class names

Scan the parse directory for module files. Return an array of available modules.

Parser::isFirst ( )

Make this module first

Returns
True or False

Modules are not run in any guaranteed order. Return True will force this module to be first (or nearly first if multiple modules override this method)

Parser::isLast ( )

Make this module last

Returns
True or False

Modules are not run in any guaranteed order. Return True will force this module to be last.

BE VERY VERY CAREFUL IF YOU OVERRIDE THIS. Quantity is the last preparse module and DefaultTender is the last parse module. Making your own module last will break one of these and probably make a mess.

Parser::parse (   $str)

Deal with the input

Parameters
$strThe input string
Returns
mixed

Parse modules a keyed array:

  • main_frame If set, change page to this URL
  • output HTML output to be displayed
  • target Javascript selector string describing which element should contain the output
  • redraw_footer True or False. Set to True if totals have changed.
  • receipt False or string type. Print a receipt with the given type.

trans_num string current transaction identifier

  • scale Update the scale display and session variables
  • udpmsg False or string. Send a message to hardware device(s)
  • retry False or string. Try the input again shortly.

The utility method default_json() provides an array with the proper keys and sane default values.

Examples:
HW_Parser.php.

The documentation for this class was generated from the following file: