shop/src/ShopShortcuts.php

Functions

Shop_Shortcuts_NormalizeItemPerPage()

Shop_Shortcuts_NormalizeItemPerPage(  $request) 

Parameters

$request

Shop_Shortcuts_GetAssociationTableName()

Shop_Shortcuts_GetAssociationTableName(\Pluf_Model  $model1, \Pluf_Model  $model2) : string

Returns association table name for given 'Pluf_Model's in many-to-many relation.

It does not check if given models have realy many-to-many relation. It returns table name if such relation would be existed.

Returned name is base of rule which Pluf is used to define association tables for two models in a many-to-many relation.

Parameters

\Pluf_Model $model1
\Pluf_Model $model2

Returns

string

Shop_Shortcuts_GetIdColumnName()

Shop_Shortcuts_GetIdColumnName(\Pluf_Model  $model) : string

Returns name of field for id of given model in a association table.

Returned name is base of rule which Pluf is used to define columns in a association table for two model in a many-to-many relation.

Parameters

\Pluf_Model $model

Returns

string

Shop_Shortcuts_GetTableName()

Shop_Shortcuts_GetTableName(\Pluf_Model  $model) : string

Returns name of table for given model.

Returned name is base of rule which Pluf is used to define name of tables for a model.

Parameters

\Pluf_Model $model

Returns

string

Shop_Shortcuts_GetItemClass()

Shop_Shortcuts_GetItemClass(string  $itemType) : string

Returns name of class which is related to given item type.

Mapping class names are now as follow:

service => Shop_Service product => Shop_Product

Parameters

string $itemType

Throws

\Pluf\Exception

Returns

string

Shop_Shortcuts_GetObjectBySecureIdOr404()

Shop_Shortcuts_GetObjectBySecureIdOr404(string  $model, string  $secureId) : object

Get an object by secure id or raise a 404 error.

Parameters

string $model

class name of object

string $secureId

secure id of object

Returns

object —

defined by $model

Shop_Shortcuts_GetTagByNameOr404()

Shop_Shortcuts_GetTagByNameOr404(string  $name) : \Shop_Tag

Returns Shop_Tag with given name.

Throws an exception (with http code 404) if there is no tag with given name.

Parameters

string $name

Throws

\Pluf_Exception_DoesNotExist

if there is no tag with given name.

Returns

\Shop_Tag