# \Thelia\Core\Template\LoopFeature

Feature loop

Class Feature

## 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

File
  Core/Template/Loop/Feature.php
Package
  \Thelia\Core\Template\Loop
Class hierarchy
  \Thelia\Core\Template\Element\BaseLoop
  \Thelia\Core\Template\Loop\Feature

## Tags

author | Etienne Roudeix eroudeix@openstudio.fr

## Properties

### $request

    $request : \Symfony\Component\HttpFoundation\Request

#### Type

\Symfony\Component\HttpFoundation\Request

#

Inherited from
  \Thelia\Core\Template\Element\BaseLoop

## Tags

None found

### $dispatcher

    $dispatcher : \Symfony\Component\EventDispatcher\EventDispatcherInterface

#### Type

\Symfony\Component\EventDispatcher\EventDispatcherInterface

#

Inherited from
  \Thelia\Core\Template\Element\BaseLoop

## Tags

None found

### $securityContext

    $securityContext : \Thelia\Core\Security\SecurityContext

#### Type

\Thelia\Core\Security\SecurityContext

#

Inherited from
  \Thelia\Core\Template\Element\BaseLoop

## Tags

None found

### $args

    $args

#

Inherited from
  \Thelia\Core\Template\Element\BaseLoop

## Tags

None found

## 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

#

abstract

Inherited from
  \Thelia\Core\Template\Element\BaseLoop

## Tags

None found

### __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 |

#

Inherited from
  \Thelia\Core\Template\Element\BaseLoop

## Tags

None found

### __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

#

Inherited from
  \Thelia\Core\Template\Element\BaseLoop

## Tags

None found

### 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

#

Inherited from
  \Thelia\Core\Template\Element\BaseLoop

## Tags

None found

### 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.

#

Inherited from
  \Thelia\Core\Template\Element\BaseLoop

## Tags

None found

### 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.

#

Inherited from
  \Thelia\Core\Template\Element\BaseLoop

## Tags

None found

### search()

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

#### Parameters

\ModelCriteria | $search |
null | $pagination |

#### Returns

array|mixed|\PropelModelPager|\PropelObjectCollection

#

Inherited from
  \Thelia\Core\Template\Element\BaseLoop

## Tags

None found

### searchWithOffset()

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

#### Parameters

\ModelCriteria | $search |

#### Returns

array|mixed|\PropelObjectCollection

#

Inherited from
  \Thelia\Core\Template\Element\BaseLoop

## Tags

None found

### searchWithPagination()

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

#### Parameters

\ModelCriteria | $search |
mixed | $pagination |

#### Returns

array|\PropelModelPager

#

Inherited from
  \Thelia\Core\Template\Element\BaseLoop

## Tags

None found

### 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

#

abstract

Inherited from
  \Thelia\Core\Template\Element\BaseLoop

## Tags

None found

### getDefaultArgs()

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

Define common loop arguments

#### Returns

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

#

Inherited from
  \Thelia\Core\Template\Element\BaseLoop

## Tags

None found

### Feature.php