NOCL_Element_Types
(Concept - Properties - Functions - Values)
Version: 1.0 (Versions)
Location: cl_objects.php
A class to provide a reference for Element Types.
Concept
The large number of different types of elements necessitates a way to reference their names in some sort of reference library.
This class provides the element Type names for parent and child elements. The difference being that there may be something liike an ingredient element being used as an item ingredient child of an item.
The element Type in this situation will be an Item, while the field, or child, will be an item ingredient.
This class is to be loaded once, and then linked back to by any child elements.
Future versions aere planned to allow for external population of the values, to enable different modules to be available and not.
Properties
-
-
- $elementType
- (Public) The basic element type names in lower case - $elementName
- (Public) The Element Type, except as public facing friendly text (e.g: capitals, and spaces instead of underscores) . - $childElementField
- (Public) The child Element field names in lower case . - $childElementFieldName
- (Private) The Child Emenet Field, except as public facing friendly text (e.g: capitals, and spaces instead of underscores)
- $elementType
-
Functions
__construct()
Version: 1.0
Called when class is instantiated
Usage:
$elementReference = new NOCL_ElementyTypes();
Paramenters:
None
Returns:
Silently after setting property values internally. Actually, returns this class as an object.
Process:
-
-
-
-
- Set the value arrays for each element. See below for breakdown of their contents
- Set the value arrays for each element. See below for breakdown of their contents
-
-
-
elementTypeNames()
Version: 1.0
Get an $elementType, except with an upper case first letter. Used for building Element Class names
Usage:
$elementReference = new NOCL_ElementyType_Names($indexId);
Paramenters:
$indexId
- The Array Index ID of the Element being looked for.
Returns:
A string containing the name of the requested element, except with its first letter in upper case.
Process:
-
-
-
-
- Get the $elementType array element at $indexId
- Set the first character to uppercase
- Return the result
- Get the $elementType array element at $indexId
-
-
-
elementTypeId()
Version: 1.0
Return the Array Element ID of a named Element Type
Usage:
$elementReferenceNumber = elementTypeId($inputString);
Paramenters:
$inputString
- The name of the Element to get the ID of
Returns:
An integer representing the Array Index of the requested Element. Or false if the name is not found
Process:
-
-
-
-
- For each Element in the $this->elementType array
- Check to see if its value is the same as the input text. Trim white space from before and after both strings
- If there is a match, return the ID of the current Array Element
- Check to see if its value is the same as the input text. Trim white space from before and after both strings
- If there has been no match, return false
- For each Element in the $this->elementType array
-
-
-
Values
- restaurant
- location
- address
- phone_number
- image
- document
- menu
- category
- item
- base
- sauce
- ingredient
- ingredient
- size
- size
- price_collection
- price
- customer
- customer_group
- order
- order_line
- delivery_type
- prep_stage
- payment
- payment_type
- payment_item
- map
- map_position
- barcode
- special
- special_ingredient
- loyalty_point
- visitor
- action
- entity
- relationship
- dietary_info
- dietary_info_item
- Restaurant
- Location
- Address
- Phone Number
- Image
- Document
- Menu
- Category
- Item
- Base
- Sauce
- Ingredient
- Ingredient
- Size
- Size
- Price Collection
- Price
- Customer
- Customer Group
- Order
- Order Line
- Delivery Type
- Prep Stage
- Payment
- Payment Type
- Payment Item
- Map
- Map Position
- Barcode
- Special
- Special Ingredient
- Loyalty Point
- Visitor
- Action
- Entity
- Relationship
- Dietary Info
- Dietary Info Item
- Restaurant
- restaurant
- location
- address
- phone_number
- image
- document
- menu
- category
- item
- base
- sauce
- ingredient
- item_ingredient
- size
- ingredient_size
- price_collection
- price
- customer
- customer_group
- order
- order_line
- delivery_type
- prep_stage
- payment
- payment_type
- payment_item
- map
- map_position
- barcode
- special
- special_ingredient
- loyalty_point
- visitor
- action
- entity
- relationship
- dietary_info
- dietary_info_item
- restaurant
- Restaurant
- Location
- Address
- Phone Number
- Image
- Document
- Menu
- Category
- Item
- Base
- Sauce
- Ingredient
- Item Ingredient
- Size
- Ingredient Size
- Price Collection
- Price
- Customer
- Customer Group
- Order
- Order Line
- Delivery Type
- Prep Stage
- Payment
- Payment Type
- Payment Item
- Map
- Map Position
- Barcode
- Special
- Special Ingredient
- Loyalty Point
- Visitor
- Action
- Entity
- Relationship
- Dietary Info
- Dietary Info Item
- Restaurant