CORE POS - Fannie
The CORE POS back end
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
FannieRESTfulPage Class Reference
Inheritance diagram for FannieRESTfulPage:
FanniePage AddPatronageEntryPage AdvancedItemSearch AlbertsPdfImport AllocatePatronagePage AnnualMeetingDetailPage AuthChangePassword AuthClassesPage AuthGroupsPage AuthPosePage AuthUsersPage BadScanTool BatchFromSearch BatchListPage CalendarAttendedEventPage CalendarFeed CashierBarGraphs CheckCouponMailing CloneItemPage CpwInvoiceImport CreatePatronageSnapshot CWMemberSummaryReport DataImportIndex EditBatchPage EditItemsFromSearch EditManyPurchaseOrders EditOnePurchaseOrder EditVendorItems EmailReport EndItemSale FannieAuthLoginPage FbeProcessQueuePage GenericBillingPage GumDefaultRatesPage GumEmailPage GumEquityPayoffPage GumIssueDividendPage GumLoanPayoffPage GumMainPage GumPromissoryPage GumReportIndex GumSchedulePage GumSearchPage GumSettingsPage GumTaxIdPage GumValidTermsPage InvoiceCostCompare ItemStatusPage ManualPurchaseOrderPage MarginBatch MarginToolFromSearch MemberPreferences MemPurchasesPage ObfCategoriesPage ObfIndexPage ObfMappingPage ObfQuarterEntryPage ObfWeekEntryPage OldSpecialOrdersPage OpenRingReceipts OriginEditor OverShortMAS PatronageCalcNet PatronageCalcRewards PatronageChecks PatronageGrossPurchases PatronageIndexPage PIApply PIKillerPage PluRangePage PurchasingIndexPage PurchasingSearchPage RestrictCouponPage ReverseTransPage SaMenuPage SaPriceChangePage ScaleEditor ShrinkEditor ShrinkReasonEditor ShrinkTool SignFromSearch SiteMap SkuMapPage SpeedTestReport StaffArAccountsPage StaffArDatesPage StatementsPluginBusiness StatementsPluginIndex StatementsPluginPostCards StatementsPluginTerm SyncFromSearch UnitBreakdownPage ViewPurchaseOrders WfcHtChangeIdPage

Public Member Functions

 readRoutes ()
 
 preprocess ()
 
 bodyContent ()
 
 unitTest ($phpunit)
 

Protected Member Functions

 unknownRequestHandler ()
 
 unknownRequestView ()
 
 getModel ($database_connection, $class, $params, $find=False)
 
 get_model ($database_connection, $class, $params, $find=False)
 

Protected Attributes

 $__method = ''
 
 $__models = array()
 
 $__routes
 
 $__route_stem = 'unknownRequest'
 

Detailed Description

A variation on the standard FanniePage using REST principles.

Four methods are available for processing user input and are automatically called based on HTTP request type:

Eight methods are available for displaying the page and are also automatically called based on request type:

A class does not need to implement handlers or views for all request types. Use as few or as many as needed.

PUT and DELETE are simulated by setting a form field named "_method".

Member Function Documentation

FannieRESTfulPage::getModel (   $database_connection,
  $class,
  $params,
  $find = False 
)
protected

Load model(s)

Parameters
$database_connectionSQLManager object
$classstring name of model class
$paramsarray of column names and values
$find[optional] string sort column or False
Returns
model object or array or model objects

If called without $find or $find=False returns a single model object. Provided $params must be sufficient to uniquely identify a single record

If called with $find then returns an array of model objects for all records that match $params and sorted by $find.

FannieRESTfulPage::readRoutes ( )

Parse request info and determine which route to use

FannieRESTfulPage::unknownRequestHandler ( )
protected

Process unknown HTTP method request

Returns
boolean Returning True draws the page Returning False does not
FannieRESTfulPage::unknownRequestView ( )
protected

Draw default page for unknown HTTP method

Returns
HTML string

Member Data Documentation

FannieRESTfulPage::$__routes
protected
Initial value:
= array(
'get',
'get<id>',
'post',
'post<id>',
'put',
'put<id>',
'delete',
'delete<id>'
)

Define available routes Syntax is request method followed by parameter names in angle brackets

method<one><two> should provide a controller function named method_one_twoHandler(). It may optionally provide a view function named method_one_twoView().

controller functions behave like FanniePage::preprocess and should return True or False.

view functions behave like FanniePage::body_content and should return an HTML string


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