\Thelia\Core\Template\LoopLang

Language loop, to get a list of available languages

  • id is the language id
  • exclude is a comma separated list of lang IDs that will be excluded from output
  • default if 1, the loop return only default lang. If 0, return all but the default language

Summary

Methods
Properties
Constants
exec()
__construct()
__call()
initializeArgs()
getArg()
getArgValue()
search()
searchWithOffset()
searchWithPagination()
No public properties found
No constants found
getArgDefinitions()
getDefaultArgs()
$request
$dispatcher
$securityContext
$args
N/A
No private methods found
No private properties found
N/A

Properties

$request

$request : \Symfony\Component\HttpFoundation\Request

Type

\Symfony\Component\HttpFoundation\Request

$dispatcher

$dispatcher : \Symfony\Component\EventDispatcher\EventDispatcherInterface

Type

\Symfony\Component\EventDispatcher\EventDispatcherInterface

$args

$args

Methods

exec()

exec(mixed $pagination) : mixed

this function have to be implement in your own loop class.

All your parameters are defined in defineArgs() and can be accessible like a class property.

example :

public function defineArgs() { return array ( "ref", "id" => "optional", "stock" => array( "optional", "default" => 10 ) ); }

you can retrieve ref value using $this->ref

Parameters

mixed $pagination

Returns

mixed

__construct()

__construct(\Symfony\Component\HttpFoundation\Request $request, \Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher, \Thelia\Core\Security\SecurityContext $securityContext)

Create a new Loop

Parameters

\Symfony\Component\HttpFoundation\Request $request
\Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher
\Thelia\Core\Security\SecurityContext $securityContext

__call()

__call(string $name, mixed $arguments) : null

Provides a getter to loop parameters

Parameters

string $name

the methode name (only getArgname is supported)

mixed $arguments

this parameter is ignored

Throws

\InvalidArgumentException

if the parameter is unknown or the method name is not supported.

Returns

null

initializeArgs()

initializeArgs(array $nameValuePairs)

Initialize the loop arguments.

Parameters

array $nameValuePairs

a array of name => value pairs. The name is the name of the argument.

Throws

\InvalidArgumentException

if somùe argument values are missing, or invalid

getArg()

getArg(string $argumentName) : \Thelia\Core\Template\Loop\Argument\Argument

Return a loop argument

Parameters

string $argumentName

the argument name

Throws

\InvalidArgumentException

if argument is not found in loop argument list

Returns

\Thelia\Core\Template\Loop\Argument\Argument

the loop argument.

getArgValue()

getArgValue(string $argumentName) : \Thelia\Core\Template\Loop\Argument\Argument

Return a loop argument value

Parameters

string $argumentName

the argument name

Throws

\InvalidArgumentException

if argument is not found in loop argument list

Returns

\Thelia\Core\Template\Loop\Argument\Argument

the loop argument.

search()

search(\ModelCriteria $search, null $pagination) : array|mixed|\PropelModelPager|\PropelObjectCollection

Parameters

\ModelCriteria $search
null $pagination

Returns

array|mixed|\PropelModelPager|\PropelObjectCollection

searchWithOffset()

searchWithOffset(\ModelCriteria $search) : array|mixed|\PropelObjectCollection

Parameters

\ModelCriteria $search

Returns

array|mixed|\PropelObjectCollection

searchWithPagination()

searchWithPagination(\ModelCriteria $search, mixed $pagination) : array|\PropelModelPager

Parameters

\ModelCriteria $search
mixed $pagination

Returns

array|\PropelModelPager

getArgDefinitions()

getArgDefinitions() : \Thelia\Core\Template\Loop\Argument\ArgumentCollection

define all args used in your loop

array key is your arg name.

example :

return array ( "ref", "id" => "optional", "stock" => array( "optional", "default" => 10 ) );

Returns

\Thelia\Core\Template\Loop\Argument\ArgumentCollection

getDefaultArgs()

getDefaultArgs() : \Thelia\Core\Template\Loop\Argument\Argument[]

Define common loop arguments

Returns

\Thelia\Core\Template\Loop\Argument\Argument[]