Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
Ecommerce_Cart Class Reference
Inheritance diagram for Ecommerce_Cart:
Listing_Engine Page Asset MySource_Object

Public Member Functions

 __construct ($assetid=0)
 
 _createBodycopies ()
 
_getCart ()
 
 getAssetList ()
 
 _getAllowedLinks ()
 
 printFrontend ()
 
 getRootNodes ()
 
 printContents ()
 
 getAssetSelectionValue ($selection_name, $assetid)
 
 _printAsset ($assetid, $list_position, $keywords=Array())
 
 getExtendedAssetKeywordReplacements ()
 
 processAssetSelections ()
 
 _validateItemUpdate ($selection_name, $quantity, $assetid)
 
 getAvailableKeywords ()
 
 onRequestKeywords (&$broadcaster, $vars=Array())
 
 getContentsKeywords ()
 
 getInsufficientQuantityMessageKeywordReplacement ()
 
 getProductCountKeywordReplacement ()
 
 getTotalValueKeywordReplacement ()
 
 _getFormSubmitMethod ()
 
- Public Member Functions inherited from Listing_Engine
 __construct ($assetid=0)
 
 _createAdditional (&$link)
 
 _createBodycopies ()
 
 _getDefaultBodycopyContent ($bodycopy_code)
 
 lockTypes ()
 
 prepareLink (&$asset, $side_of_link, &$link_type, &$value, &$sort_order, &$dependant, &$exclusive)
 
 describeLink ($linkid)
 
 isDeletableLink ($linkid)
 
 cloneComponentsAdditional (&$clone, $components)
 
 _getAllowedLinks ()
 
getFolder ($type='type_formats')
 
 getFormats ($type='type_formats')
 
 printBody ()
 
 _getFormUrlComponents ()
 
 printNoResultsBodycopy (&$keywords)
 
 printContents ()
 
 _getCacheKey ()
 
 _getNumPerPage ()
 
 getAssetList ()
 
 sortAssetList ($asset_list, $sort_info)
 
 filterAssetList (&$todo)
 
 filterAssetStatuses (&$todo)
 
 filterAssetTypes (&$todo)
 
 getAllowedAssetTypeMap ()
 
 adjustAssetPositions (&$todo)
 
getChunk (&$children, &$replacements, $keywords, $result_page, $num_per_page, $group_by=NULL)
 
 _getPageList ($total_pages, $current_page, $window_size=NULL)
 
 _groupChunk (&$todo, &$chunk, &$remaining_count, $num_per_page, $group_limit=NULL)
 
 printAssetList ($todo)
 
 _printGroups (&$todo, $group_info)
 
 _printAssetList ($todo)
 
 _getShadowAssetKeywordReplacements ($assetid, $bc_keywords)
 
 _printAsset ($assetid, $list_position, $num_items=0)
 
_getTypeFormatBodycopy ($type_code)
 
 _getSelectionFieldNamePrefix ($selection_name)
 
 getSortableAssetInfo ()
 
 getRootNodes ($reload=TRUE)
 
 getExtendedAssetKeywordReplacements ()
 
 isDescending ()
 
 registerFormField ($field_name)
 
 getUsedFormFields ()
 
 getSortInfo ()
 
 groupAssetsRecursively ($group_levels, $assetids, &$results)
 
 limitAssetsRecursively (&$results, $limit_array)
 
 getGroupableParentAssetids ($child_assetid, $restrict_types=Array(), $direct_parent_only=FALSE)
 
convertProxyAssetTypes (&$results)
 
 _getGroupableParentAssetids ($child_assetid, $restrict_types=Array(), $root_nodes=Array(), $direct_parent_only=FALSE)
 
 sortGroups ($group_levels, $assetids, &$results)
 
 reindexGroupFormats ()
 
 processAssetSelections ()
 
 getAssetSelectionValue ($selection_name, $assetid)
 
 getAssetSelectionDefaults ()
 
 getAssetTargetDefaults ()
 
 _arrayCountRecursive (&$array, $limit=NULL)
 
 _getPositionFormats ()
 
 onRequestKeywords (&$broadcaster, $vars=Array())
 
 _getGenericSingleAssetFormatKeywords ($type=NULL)
 
 _getAdditionalSingleAssetFormatKeywords ()
 
 getAvailableKeywords ()
 
 _getContentsKeywords ()
 
 _getTypeFormatsKeywords ()
 
 _getGroupFolderKeywords ()
 
 getKeywordReplacement ($original_keyword)
 
 getContentsKeywordReplacements ($keywords=Array())
 
 getSortByKeywordReplacement ()
 
 getSortOrderKeywordReplacement ()
 
 getSubmitButtonKeywordReplacement ()
 
 getResetButtonKeywordReplacement ()
 
 getRootNodesKeywordReplacement ()
 
 getAssetTargetKeywordReplacement ($name)
 
 getStructuredRootNodeKeywordReplacement ()
 
 getSelectAllJSCodeKeywordReplacement ()
 
 _recurseCheckAllRelations (&$todo, &$relations, $prefix, $limit=NULL)
 
 _analyseCheckAllRelations ($todo)
 
 _buildRelationsJS ()
 
 _getFormSubmitMethod ()
 
 createNoResultsBodycopy ($enable_on_create=TRUE)
 
getNoResultsBodycopy ($only_if_enabled=TRUE)
 
 isNoResultsBodycopyEnabled ()
 
 setUseNoResultsBodycopy ($enabled)
 
- Public Member Functions inherited from Page
 __construct ($assetid=0)
 
 _getAllowedLinks ()
 
 printBody ()
 
- Public Member Functions inherited from Asset
 Asset ($assetid=0)
 
 create (Array &$link)
 
 load ($assetid)
 
 _loadDataPaths ()
 
 reload ()
 
 canDelete ()
 
 delete ($release_lock=TRUE, $check_locked=TRUE)
 
 useSystemVersion ()
 
 loadSystemVersion ()
 
 saveSystemVersion ()
 
 clearSystemVersion ()
 
 revertToSystemVersion ()
 
 revertNoticeLinksToSystemVersion ()
 
 _updated ($update_parents=TRUE)
 
 type ()
 
 getTypeAncestors ($include_asset=TRUE)
 
 incrementVersion ($number='micro', $update_parents=TRUE)
 
 getLanguages ()
 
 setLanguages (Array $languages)
 
 setCharset ($charset)
 
 setForceSecure ($force_secure)
 
 remapAssetids (Array $map)
 
 morph ($new_type_code)
 
 _morphCleanup ($new_type_code)
 
 onRequestKeywords (Asset $broadcaster, Array $vars=Array())
 
 canClone ()
 
 cloneComponents (Asset $clone, Array $components, $override=FALSE)
 
 cloneComponentsAdditional (Asset $clone, Array $components)
 
 cloneLinks (Asset $clone)
 
 getStatus ()
 
 getAvailableStatii ()
 
 getStatusDescription ()
 
 processStatusChange ($new_status, $update_parents=TRUE, $run_updated=TRUE)
 
 setDate ($date_type, $time=NULL, $userid=NULL)
 
 lockTypes ()
 
 canForceablyAcquireLock ($lock_type)
 
 getEditingLocks ($keywords)
 
 _getAllowedLinks ()
 
 createLink (Asset $minor, $link_type, $value='', $sort_order=NULL, $dependant='0', $exclusive='0', $moving=FALSE, $locked=0)
 
 prepareLink (Asset $asset, $side_of_link, &$link_type, &$value, &$sort_order, &$dependant, &$exclusive)
 
 canCreateLink (Asset $minor, $link_type, $exclusive)
 
 canMoveLink (Asset $minor, Asset $old_major, $link_type)
 
 describeLink ($linkid)
 
 isDeletableLink ($linkid)
 
 canDeleteLink ($linkid)
 
 deleteLink ($linkid, $check_locked=TRUE)
 
 linksUpdated ()
 
 canCloneLink ()
 
 saveAttributes ($dont_run_updated=FALSE, $log_message=TRUE)
 
 setAttrValue ($name, $value)
 
 attr ($name)
 
attrByRef ($name)
 
 getAttribute ($name, $mute_errors=FALSE)
 
 getAssetKeywords ($descriptions=FALSE)
 
 getAvailableKeywords ()
 
 getKeywordReplacement ($keyword)
 
 getAssetWebPathKeywordReplacement ()
 
 getCustomKeywordReplacements ($keywords=Array(), $invoke_backend=FALSE)
 
 processCustomKeywords ($keywords=Array())
 
 getContent ()
 
 setContent ()
 
 getEffectiveLastUpdatedTime ($assetids)
 
 readAccess (Array $assetids=Array())
 
 writeAccess ($lock_type='', Array $assetids=Array(), $only_workflow=TRUE)
 
 adminAccess ($lock_type='', Array $assetids=Array())
 
 backendAccess ()
 
 liveEditAccess ($lock_type)
 
 canliveEdit ($lock_type)
 
 effectiveUnrestricted ()
 
 checkAccess ($perm, $lock_type, Array $assetids=Array(), $only_workflow=TRUE)
 
 accessEffective ()
 
 permissionsUpdated ()
 
 printFrontend ()
 
 printFrontendAsset (Asset $asset, $design=NULL)
 
 getValidProtocols ()
 
 printHead ()
 
 printBody ()
 
 getCurrentPaintLayoutName ()
 
 getCurrentDesignName ()
 
 printBodyWithPaintLayout ($layout_id='')
 
 initLimbo ()
 
 printLimbo ()
 
 paintBackend (Backend_Outputter $o)
 
 getPrefix ()
 
 processBackend (Backend_Outputter $o, Array &$link)
 
 getEI ()
 
 getEditFns ()
 
 getBackendHref ($screen='', $backend_page=TRUE)
 
 getURL ($base_url=NULL, $ignore_rollback=FALSE, $base_contextid=NULL)
 
 getURLs ()
 
 getHref ($base_url=NULL, $ignore_rollback=FALSE)
 
 getWebDataPath ()
 
 getWebPaths ()
 
 saveWebPaths ($paths, $auto_add_remaps=TRUE)
 
 getLookups ($field='')
 
 getDesignLookups ()
 
 getLookupValues ($inherited=NULL, $prefix='', $like_search=TRUE, $ignore_override=FALSE)
 
 deleteLookupValue ($layout_name, $layout_value)
 
 setPaintLayouts ($layouts)
 
 updateLookups ($auto_add_remaps=TRUE)
 
 setLookupValues (Array $values)
 
 getAssetStatusDescriptionKeywordReplacement ()
 
 getAssetStatusColourKeywordReplacement ()
 
 replaceKeywordsInString ($string)
 
 fastTrack ($tasks)
 
 unFastTrack ($tasks)
 
 shouldFastTrack ($task, $assetid=NULL)
 
 getFaskTrackedTaskAssetids ($task)
 
 getDependantParentsURL ()
 
- Public Member Functions inherited from MySource_Object
 MySource_Object ()
 
 __sleep ()
 
 __wakeup ()
 

Data Fields

 $_cart = NULL
 
 $insufficient_quantities = FALSE
 
 $insufficient_quantity_assets = NULL
 
- Data Fields inherited from Listing_Engine
 $requires_form = FALSE
 
 $performance_log_file_name = 'performance'
 
 $performance_threshold = 1000
 

Protected Member Functions

 _getName ($short_name=FALSE, $contextid=NULL)
 
- Protected Member Functions inherited from Listing_Engine
 _getAssetContentsBCKeywordReplacement (Asset $asset, $contextid=NULL)
 
 _getAssetContentsRawBCKeywordReplacement (Asset $asset, $contextid=NULL)
 
 _getAssetContentsPaintBCKeywordReplacement (Asset $asset, $paint_layout, $contextid=NULL)
 
- Protected Member Functions inherited from Page
 _preCreateCheck (Array &$link)
 
 _createAdditional (Array &$link)
 
 _getName ($short_name=FALSE)
 
- Protected Member Functions inherited from Asset
 _preCreateCheck (Array &$link)
 
 _createAdditional (Array &$link)
 
 _abortCreate ($trigger_level_changed=FALSE, $linkid=0)
 
 _loadVars ()
 
 _getName ($short_name=FALSE, $contextid=NULL)
 
 _getKeywordReplacement ($keyword)
 
 _checkPermissionAccess ($perm, $assetids=Array(), $only_workflow=TRUE)
 
 makeAndSaveInitialWebPath ($path, $parent_link=NULL)
 

Detailed Description

Definition at line 37 of file ecommerce_cart.inc.

Constructor & Destructor Documentation

__construct (   $assetid = 0)

Constructor

Parameters
string$assetidthe assetid of the asset to load into this object
Returns
void public

Definition at line 71 of file ecommerce_cart.inc.

Member Function Documentation

_createBodycopies ( )

Creates bodycopies for this asset

Overridden, as the Ecommerce_Cart uses the 'no_items_text' attribute instead of a No Results bodycopy

Returns
boolean protected

Definition at line 86 of file ecommerce_cart.inc.

_getAllowedLinks ( )

Returns an array of all the permitted link type, the type asset and the cardinality

Returns
array private
See Also
Asset::_getAllowLinks()

Definition at line 179 of file ecommerce_cart.inc.

& _getCart ( )

Gets the current cart. If it doesn't yet exist, create a new one

Returns
object private

Definition at line 103 of file ecommerce_cart.inc.

_getFormSubmitMethod ( )

Get the current form submit method (always POST)

Returns
string protected

Definition at line 895 of file ecommerce_cart.inc.

_getName (   $short_name = FALSE,
  $contextid = NULL 
)
protected

Returns name of the asset

Parameters
boolean$short_namewhether or not we are after the shortname or the full name
int$contextidwhat context to return the name from
Returns
string private
See Also
Asset::_getName()

Definition at line 200 of file ecommerce_cart.inc.

_printAsset (   $assetid,
  $list_position,
  $keywords = Array() 
)

Prints the individual asset in the asset list {description} This is being overridden to cache the results of each asset, and add the score and result number keyword replacements

Note that the second parameter is score and not type code. This is because we send the search results which is (assetid => score) instead of (assetid => type_code). It still works - and allows us to add the score keyword easily - but we turn it into the correct format when sending to the listing engine.

Parameters
string$assetidThe assetid of the asset we are printing
string$list_positionthe position of this asset in the list
array$keywordsany keywords to replace when printing
Returns
void protected

Definition at line 453 of file ecommerce_cart.inc.

_validateItemUpdate (   $selection_name,
  $quantity,
  $assetid 
)

Checks that the new value for the selection is valid, and matches the conditions set on the Asset Selection screen for that selection, and modifies the quanitity to match these conditions if necessary

Returns the new quantity

Parameters
string$selection_namethe id of the asset selection
int$quantitythe quantity to be assigned to the selection
int$assetidthe id of the asset we are validating
Returns
int private

Definition at line 605 of file ecommerce_cart.inc.

getAssetList ( )

Get the list of asset that should be printed

This is defined as an abstract method of sorts; it's up to the kids to override this The return array is in the form Array(assetid => type_code) unless we are grouping by letter, in which case the return array is

Array(assetid => Array(
                    'type_code' => type_code,
                    'first_letter' => first_letter,
                    );
    );
Returns
array protected

Definition at line 138 of file ecommerce_cart.inc.

getAssetSelectionValue (   $selection_name,
  $assetid 
)

Provide the default values for each of the selection fields Ecom grabs its values from the cart

Parameters
string$selection_namethe id of the asset selection
string$assetidthe assetid of the item to grab out of the cart
Returns
int public

Definition at line 416 of file ecommerce_cart.inc.

getAvailableKeywords ( )

Return the available keywords

The return value is in the form:

Array(
    'keyword' => 'name',
)
Returns
array public

Definition at line 721 of file ecommerce_cart.inc.

getContentsKeywords ( )

Return the available keywords in the Page Contents Bodycopy for this asset

The return value is in the form:

Array(
    'keyword' => 'name',
)
Returns
array public

Definition at line 798 of file ecommerce_cart.inc.

getExtendedAssetKeywordReplacements ( )

Returns a list of extra keywords that should be replaced for a particular listing asset, in the format: Array(keyword name => replacement)

This allows search page, for instance, to define its result number and score fields so they don't blank out when keywords are replaced in listing engine.

Returns
array public

Definition at line 487 of file ecommerce_cart.inc.

getInsufficientQuantityMessageKeywordReplacement ( )

Get insufficient_quantity_message keyword replacement

Returns
string protected

Definition at line 833 of file ecommerce_cart.inc.

getProductCountKeywordReplacement ( )

Product Count keyword replacement

Returns
string private

Definition at line 865 of file ecommerce_cart.inc.

getRootNodes ( )

Gets the list of current root nodes

Returns
array public

Definition at line 245 of file ecommerce_cart.inc.

getTotalValueKeywordReplacement ( )

Total Value keyword replacement

Returns
string private

Definition at line 880 of file ecommerce_cart.inc.

onRequestKeywords ( $broadcaster,
  $vars = Array() 
)

Add valid keywords for this asset to an array of keywords when asked

Parameters
object&$broadcasterthe asset that triggered the event
array$varsthe vars that get submitted by the broadcaster we add keywords to the $vars['keywords'] array
Returns
boolean private

Definition at line 742 of file ecommerce_cart.inc.

printContents ( )

Constructs the carts contents

Returns
void public

Definition at line 258 of file ecommerce_cart.inc.

printFrontend ( )

Prints out the Frontend for this asset

Returns
void public

Definition at line 225 of file ecommerce_cart.inc.

processAssetSelections ( )

Preprocess the Asset Selection values before displaying the page or redirecting Overwritten by the cart to handle the processing of cart updates using preset asset selections and dynamic parameters

Returns
boolean public

Definition at line 507 of file ecommerce_cart.inc.


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