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 AddCashierPage AddPatronageEntryPage addShelfTag AdvancedBatchEditor AdvancedItemSearch AllocatePatronagePage AnnualMeetingDetailPage AuthBarcodePage AuthChangePassword AuthClassesPage AuthGroupsPage AuthPagePermissions AuthPosePage AuthUsersPage BadScanTool BaseItemAjax BatchFromSearch BatchImportExportPage BatchListPage BatchSignStylesPage CalendarAttendedEventPage CalendarDeletePage CalendarFeed CashierBarGraphs CheckCouponMailing CloneItemPage ConsistencyRulesPage CoopDealsLookupPage CoopDealsMergePage COREPOS\Fannie\API\FannieCRUDPage COREPOS\Fannie\API\FannieReadOnlyPage CpwInvoiceImport CreatePatronageSnapshot CWMemberSummaryReport DashBoard DataImportIndex DateCountPage DeleteItemPage DeleteTenderPage DeleteVendorPage DeliCateringOrdersPage DepartmentDiscrepancyNew DepartmentEditor ECouponReport EditBatchPage EditItemsFromSearch EditManyPurchaseOrders EditOnePurchaseOrder EditShelfTags EditVendorItems EdlpBatchPage EmailReport EndItemSale FannieAuthLoginPage FbeProcessQueuePage GenericBillingPage genLabels GumDefaultRatesPage GumEmailPage GumEquityPayoffPage GumIssueDividendPage GumLoanPayoffPage GumMainPage GumPromissoryPage GumReportIndex GumSchedulePage GumSearchPage GumSettingsPage GumTaxIdPage GumValidTermsPage IgnoredBarcodeEditor InactiveReasonEditor IncompleteItemsPage InvCountPage ItemStatusPage LaneTextStringPage ManualPurchaseOrderPage ManualSignsPage MarginToolFromSearch MemArTransferTool MemberPreferences MemberTypeEditor MemPurchasesPage MetaRules NewSpecialOrdersPage NutriFacts ObfCategoriesPage ObfCategoriesPageV2 ObfIndexPage ObfIndexPageV2 ObfMappingPage ObfQuarterEntryPage ObfWeekEntryPage ObfWeekEntryPageV2 OpenRingReceipts OrderAjax OrderDeptMap OrderDiscountsPage OrderReviewPage OrderViewPage OriginEditor OrphanedItemsPage OverShortMAS PatronageCalcNet PatronageCalcRewards PatronageChecks PatronageGrossPurchases PatronageIndexPage PaymentPlanEditor PIApply PIKillerPage PISignaturePage PluRangePage PriceDiscrepancyPage ProdLocationEditor PurchasingIndexPage PurchasingSearchPage QrTagPage RecalculateVendorSRPs RenameVendorPage RestrictCouponPage ReverseTransPage SaMenuPage SaPriceChangePage ScaleEditor ScheduledEmailTemplatePage ShrinkEditor ShrinkIndex ShrinkReasonEditor ShrinkTool SiteMap SiteSearch SkuMapPage SpecialOrderTags StaffArAccountsPage StaffArDatesPage StatementsPluginBusiness StatementsPluginIndex StatementsPluginPostCards StatementsPluginTerm SyncFromSearch TaxRateEditor TenderEditor TransferPurchaseOrder TsEmployeesEditor UnitBreakdownPage VendorIndexPage VendorMarginsPage VendorPricingBatchPage ViewCashiersPage ViewPurchaseOrders WaybackMachine WfcHtChangeIdPage WfcHtEvalList WfcHtEvalView WicableByDepartment WicUpdatePage

Public Member Functions

 readRoutes ()
 
 addRoute ()
 
 preprocess ()
 
 bodyContent ()
 
 unitTest ($phpunit)
 
 setForm (COREPOS\common\mvc\ValueContainer $f)
 
- Public Member Functions inherited from FanniePage
 preprocess ()
 
 getHeader ()
 
 addBootstrap ()
 
 addJQuery ()
 
 get_header ()
 
 getFooter ()
 
 get_footer ()
 
 loginRedirect ()
 
 login_redirect ()
 
 checkAuth ()
 
 check_auth ()
 
 helpContent ()
 
 preFlight ()
 
 postFlight ()
 
 setPermissions ($p)
 

Protected Member Functions

 checkRoute ($route, $try_routes)
 
 bestRoute ($try_routes)
 
 unknownRequestHandler ()
 
 unknownRequestView ()
 
 getModel ($database_connection, $class, $params, $find=False)
 
 get_model ($database_connection, $class, $params, $find=False)
 
- Protected Member Functions inherited from FanniePage
 lineaJS ()
 
 helpModal ()
 

Protected Attributes

 $__method = ''
 
 $__models = array()
 
 $__routes
 
 $__route_stem = 'unknownRequest'
 
 $form
 
 $routing_trait
 
- Protected Attributes inherited from FanniePage
 $must_authenticate = false
 
 $current_user = false
 
 $auth_classes = array()
 
 $title = 'Page window title'
 
 $header = 'Page displayed header'
 
 $enable_linea = false
 

Additional Inherited Members

- Public Attributes inherited from FanniePage
 $themed = true
 

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::setForm ( COREPOS\common\mvc\ValueContainer  $f)

Set the form value container

Parameters
[ValueContainer]$f Accepts a generic ValueContainer instead of a FormValueContainer so that unit tests can inject preset values
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: