\Oxws_Categories

Functions related to categories

Summary

Methods
Properties
Constants
getConfig()
getDb()
fetchCategories()
insertCategory()
updateCategory()
fetchCategory()
fetchSubCats()
fetchParentCategory()
setParentCat()
getMostOrderedCategory()
No public properties found
No constants found
No protected methods found
$myConfig
$oDb
$_blUseLazyLoading
N/A
No private methods found
No private properties found
N/A

Properties

$myConfig

$myConfig : object

Config object

Type

object

$oDb

$oDb : object

Database object

Type

object

$_blUseLazyLoading

$_blUseLazyLoading : boolean

Allow lazy loading

Type

boolean

Methods

getConfig()

getConfig() : object

Function to get config object

Returns

object

getDb()

getDb() : object

Function to get database object

Returns

object

fetchCategories()

fetchCategories(integer  $start, integer  $offset = 10) : array

Function to get categories

Parameters

integer $start

start index of the fetchCategories result (optional)

integer $offset

offset index of the fetchCategories result (optional)

Returns

array

insertCategory()

insertCategory(\JSONstring  $category) : boolean

Function to insert a category

Parameters

\JSONstring $category

json string with category details as key=>value pairs to insert. Ex: 'oxactive'=>'xxxxx', 'oxtitle'=>'xxxxx'.

Returns

boolean

updateCategory()

updateCategory(\JSONstring  $category) : boolean

Function to update a category

Parameters

\JSONstring $category

json string with category details as key=>value pairs to update. Ex: 'oxid'=>'xxxxx', 'oxtitle'=>'xxxxx'.

Returns

boolean

fetchCategory()

fetchCategory(string  $categoryId) : array

Function to get a category details

Parameters

string $categoryId

category Id to get the details

Returns

array

fetchSubCats()

fetchSubCats(string  $categoryId) : array

Function to sub categories a category

Parameters

string $categoryId

category Id to get its sub categories

Returns

array

fetchParentCategory()

fetchParentCategory(string  $categoryId) : array

Function to get parent category of a category

Parameters

string $categoryId

category Id to get its parent category

Returns

array

setParentCat()

setParentCat(string  $subcategoryId, string  $parentcategoryId) : null

Function to set parent category for a category

Parameters

string $subcategoryId

category Id to set it as a child category

string $parentcategoryId

category Id to set it as a parent category

Returns

null

getMostOrderedCategory()

getMostOrderedCategory(string  $type = null) : array

Function to fetch category which ordered most number of times.

Parameters

string $type

type of the request like most ordered category item in current month, day, year, ...

Returns

array