\Categories\ServiceCategories

Class Categories

Summary

Methods
Properties
Constants
getServiceLocator()
__construct()
updateChildrenPath()
getTreeForRoot()
getSession()
clearImages()
ifImagesExist()
addImageToSession()
No public properties found
No constants found
No protected methods found
$serviceManager
N/A
recursiveUpdatePath()
No private properties found
N/A

Properties

$serviceManager

$serviceManager : null|\Zend\ServiceManager\ServiceManager

Type

null|\Zend\ServiceManager\ServiceManager

Methods

getServiceLocator()

getServiceLocator() : null|\Zend\ServiceManager\ServiceManager

Returns

null|\Zend\ServiceManager\ServiceManager

__construct()

__construct(\Zend\ServiceManager\ServiceManager  $sm) 

Parameters

\Zend\ServiceManager\ServiceManager $sm

updateChildrenPath()

updateChildrenPath(\Categories\Entity\Categories  $category) 

Updates a `path` field of each child of parent category.

Parameters

\Categories\Entity\Categories $category

Parent category

getTreeForRoot()

getTreeForRoot(  $alias) : null|\Categories\Entity\Categories

Gets tree for some root category.

Parameters

$alias

Alias of the root category

Returns

null|\Categories\Entity\Categories

getSession()

getSession() : \Zend\Session\Container

Gets session.

Returns

\Zend\Session\Container

clearImages()

clearImages() 

Clears image variable of current session.

ifImagesExist()

ifImagesExist() : boolean

Checks if images exist in session.

Returns

boolean

addImageToSession()

addImageToSession(\Media\Entity\File  $image) 

Adds new image id to session

Parameters

\Media\Entity\File $image

recursiveUpdatePath()

recursiveUpdatePath(  $tree,   $path,   $entityManager) : boolean

Recursively search category tree and sets path for each node.

Parameters

$tree

array Category tree

$path

string Path of each parent

$entityManager

\Doctrine\ORM\EntityManager

Returns

boolean