diff --git a/documentation/api/classes/Thelia.Action.Category.html b/documentation/api/classes/Thelia.Action.Category.html new file mode 100644 index 000000000..c2a3d2a18 --- /dev/null +++ b/documentation/api/classes/Thelia.Action.Category.html @@ -0,0 +1,2035 @@ + + + + + + API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\Thelia\ActionCategory

+

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ create()
+ modify()
+ delete()
+ toggleVisibility()
+ getSubscribedEvents()
+
+
+ No public properties found +
+
+ No constants found +
+
+
+
+ validateForm()
+ propagateFormError()
+ redirect()
+
+
+ No protected properties found +
+
+ N/A +
+
+
+
+ No private methods found +
+
+ No private properties found +
+
+ N/A +
+
+
+
+ +
+ + + + +
+

Methods

+ +
+ +
+
+ + +
+ +
+ +
+
+ + +
+ +
+ +
+
+ +
+

delete()

+ +
delete(\Thelia\Core\Event\ActionEvent $event)
+

Delete a category

+ + + +

Parameters

+ + + + + + +
\Thelia\Core\Event\ActionEvent$event +
+ + +
+
+ +
+ +
+
+ +
+

toggleVisibility()

+ +
toggleVisibility(\Thelia\Core\Event\ActionEvent $event)
+

Toggle category visibility. No form used here

+ + + +

Parameters

+ + + + + + +
\Thelia\Core\Event\ActionEvent$event +
+ + +
+
+ +
+ +
+
+ +
+

getSubscribedEvents()

+ +
getSubscribedEvents() : array
+

Returns an array of event names this subscriber listens to.

+

The array keys are event names and the value can be:

+ +
    +
  • The method name to call (priority defaults to 0)
  • +
  • An array composed of the method name to call and the priority
  • +
  • An array of arrays composed of the method names to call and respective +priorities, or 0 if unset
  • +
+ +

For instance:

+ +
    +
  • array('eventName' => 'methodName')
  • +
  • array('eventName' => array('methodName', $priority))
  • +
  • array('eventName' => array(array('methodName1', $priority), array('methodName2'))
  • +
+ + + + +

Returns

+ array + —

The event names to listen to

+ +
+
+ +
+ +
+
+ +
+

validateForm()

+ +
validateForm(\Thelia\Form\BaseForm $aBaseForm,  $expectedMethod)
+

+ + + +

Parameters

+ + + + + + + + + + + +
\Thelia\Form\BaseForm$aBaseForm +
$expectedMethod +
+ + +
+
+ +
+ +
+
+ +
+

propagateFormError()

+ +
propagateFormError(\Thelia\Form\BaseForm $aBaseForm, string $error_message, \Thelia\Core\Event\ActionEvent $event)
+

+ + + +

Parameters

+ + + + + + + + + + + + + + + + +
\Thelia\Form\BaseForm$aBaseForm +
string$error_message +
\Thelia\Core\Event\ActionEvent$event +
+ + +
+
+ +
+ +
+
+ +
+

redirect()

+ +
redirect( $url,  $status)
+

+ + + +

Parameters

+ + + + + + + + + + + +
$url +
$status +
+ + +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/documentation/api/classes/Thelia.Action.Exception.FormValidationException.html b/documentation/api/classes/Thelia.Action.Exception.FormValidationException.html new file mode 100644 index 000000000..2128fa82a --- /dev/null +++ b/documentation/api/classes/Thelia.Action.Exception.FormValidationException.html @@ -0,0 +1,1696 @@ + + + + + + API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\Thelia\Action\ExceptionFormValidationException

+

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ No public methods found +
+
+ No public properties found +
+
+ No constants found +
+
+
+
+ No protected methods found +
+
+ No protected properties found +
+
+ N/A +
+
+
+
+ No private methods found +
+
+ No private properties found +
+
+ N/A +
+
+
+
+ +
+ + + +
+
+ + + + +
+ + + diff --git a/documentation/api/classes/Thelia.Cart.CartTrait.html b/documentation/api/classes/Thelia.Cart.CartTrait.html new file mode 100644 index 000000000..49658c617 --- /dev/null +++ b/documentation/api/classes/Thelia.Cart.CartTrait.html @@ -0,0 +1,1692 @@ + + + + + + API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\Thelia\CartCartTrait

+

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ No public methods found +
+
+ No public properties found +
+
+ No constants found +
+
+
+
+ No protected methods found +
+
+ No protected properties found +
+
+ N/A +
+
+
+
+ No private methods found +
+
+ No private properties found +
+
+ N/A +
+
+
+
+ +
+ + + +
+
+ + + + +
+ + + diff --git a/documentation/api/classes/Thelia.Core.Event.CategoryEvent.html b/documentation/api/classes/Thelia.Core.Event.CategoryEvent.html new file mode 100644 index 000000000..74a14bad8 --- /dev/null +++ b/documentation/api/classes/Thelia.Core.Event.CategoryEvent.html @@ -0,0 +1,1768 @@ + + + + + + API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\Thelia\Core\EventCategoryEvent

+

Base class used for internal event like creating new Customer, adding item to cart, etc

+

Class InternalEvent

+ + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ __construct()
+
+
+ $category
+
+
+ No constants found +
+
+
+
+ No protected methods found +
+
+ No protected properties found +
+
+ N/A +
+
+
+
+ No private methods found +
+
+ No private properties found +
+
+ N/A +
+
+
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$category

+
$category
+

+ + + +
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

__construct()

+ +
__construct(\Thelia\Model\Category $category)
+

+ + + +

Parameters

+ + + + + + +
\Thelia\Model\Category$category +
+ + +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/documentation/api/classes/Thelia.Core.Security.Exception.AuthorizationException.html b/documentation/api/classes/Thelia.Core.Security.Exception.AuthorizationException.html new file mode 100644 index 000000000..d56bc0cbe --- /dev/null +++ b/documentation/api/classes/Thelia.Core.Security.Exception.AuthorizationException.html @@ -0,0 +1,1694 @@ + + + + + + API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\Thelia\Core\Security\ExceptionAuthorizationException

+

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ No public methods found +
+
+ No public properties found +
+
+ No constants found +
+
+
+
+ No protected methods found +
+
+ No protected properties found +
+
+ N/A +
+
+
+
+ No private methods found +
+
+ No private properties found +
+
+ N/A +
+
+
+
+ +
+ + + +
+
+ + + + +
+ + + diff --git a/documentation/api/classes/Thelia.Core.Template.Loop.CategoryTree.html b/documentation/api/classes/Thelia.Core.Template.Loop.CategoryTree.html new file mode 100644 index 000000000..7a2fb1a8e --- /dev/null +++ b/documentation/api/classes/Thelia.Core.Template.Loop.CategoryTree.html @@ -0,0 +1,2398 @@ + + + + + + API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\Thelia\Core\Template\LoopCategoryTree

+

Category tree loop, to get a category tree from a given category to a given depth.

+
    +
  • category is the category id
  • +
  • depth is the maximum depth to go, default unlimited
  • +
  • visible if true or missing, only visible categories will be displayed. If false, all categories (visible or not) are returned.
  • +
+ + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ exec()
+ __construct()
+ __call()
+ initializeArgs()
+ getArg()
+ getArgValue()
+ search()
+ searchWithOffset()
+ searchWithPagination()
+
+
+ No public properties found +
+
+ No constants found +
+
+
+
+ getArgDefinitions()
+ buildCategoryTree()
+ 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 +
+
+ +
+ +
+
+ +
+

buildCategoryTree()

+ +
buildCategoryTree( $parent,  $visible,  $level,  $max_level, array $exclude, \Thelia\Core\Template\Element\LoopResult $loopResult)
+

+ + + +

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
$parent +
$visible +
$level +
$max_level +
array$exclude +
\Thelia\Core\Template\Element\LoopResult$loopResult +
+ + +
+
+ +
+ +
+
+ +
+

getDefaultArgs()

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

Define common loop arguments

+ + + + + +

Returns

+ \Thelia\Core\Template\Loop\Argument\Argument[] +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/documentation/api/classes/Thelia.Core.Template.Loop.Lang.html b/documentation/api/classes/Thelia.Core.Template.Loop.Lang.html new file mode 100644 index 000000000..2f3c5b7ce --- /dev/null +++ b/documentation/api/classes/Thelia.Core.Template.Loop.Lang.html @@ -0,0 +1,2332 @@ + + + + + + API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\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[] +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/documentation/api/classes/Thelia.Form.CategoryCreationForm.html b/documentation/api/classes/Thelia.Form.CategoryCreationForm.html new file mode 100644 index 000000000..a44ca0e95 --- /dev/null +++ b/documentation/api/classes/Thelia.Form.CategoryCreationForm.html @@ -0,0 +1,2339 @@ + + + + + + API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\Thelia\FormCategoryCreationForm

+

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ getName()
+ __construct()
+ getRequest()
+ getSuccessUrl()
+ createView()
+ getView()
+ setError()
+ hasError()
+ setErrorMessage()
+ getErrorMessage()
+ getForm()
+
+
+ No public properties found +
+
+ No constants found +
+
+
+
+ buildForm()
+ cleanOptions()
+
+
+ $formBuilder
+ $form
+ $request
+
+
+ N/A +
+
+
+
+ No private methods found +
+
+ $view
+ $has_error
+ $error_message
+
+
+ N/A +
+
+
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$formBuilder

+
$formBuilder : \Symfony\Component\Form\FormFactoryInterface
+

+ + + +

Type

+ \Symfony\Component\Form\FormFactoryInterface +
+
+ +
+ +
+
+ +
+

$form

+
$form : \Symfony\Component\Form\Form
+

+ + + +

Type

+ \Symfony\Component\Form\Form +
+
+ +
+ +
+
+ +
+

$request

+
$request
+

+ + + +
+
+ +
+ +
+
+ +
+

$view

+
$view
+

+ + + +
+
+ +
+ +
+
+ +
+

$has_error

+
$has_error : boolean
+

true if the form has an error, false otherwise.

+ + + +

Type

+ boolean +
+
+ +
+ +
+
+ +
+

$error_message

+
$error_message : string
+

The form error message.

+ + + +

Type

+ string +
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

getName()

+ +
getName() : string
+

+ + + + + +

Returns

+ string + —

the name of you form. This name must be unique

+ +
+
+ +
+ +
+
+ +
+

__construct()

+ +
__construct(\Symfony\Component\HttpFoundation\Request $request,  $type,  $data,  $options)
+

+ + + +

Parameters

+ + + + + + + + + + + + + + + + + + + + + +
\Symfony\Component\HttpFoundation\Request$request +
$type +
$data +
$options +
+ + +
+
+ +
+ +
+
+ +
+

getRequest()

+ +
getRequest()
+

+ + + + + +
+
+ +
+ +
+
+ +
+

getSuccessUrl()

+ +
getSuccessUrl(string $default) : string
+

Returns the absolute URL to redirect the user to if the form is successfully processed.

+ + + +

Parameters

+ + + + + + +
string$default

the default URL. If not given, the configured base URL is used.

+
+ + +

Returns

+ string + —

an absolute URL

+ +
+
+ +
+ +
+
+ +
+

createView()

+ +
createView()
+

+ + + + + +
+
+ +
+ +
+
+ +
+

getView()

+ +
getView()
+

+ + + + + +
+
+ +
+ +
+
+ +
+

setError()

+ +
setError(boolean $has_error)
+

Set the error status of the form.

+ + + +

Parameters

+ + + + + + +
boolean$has_error +
+ + +
+
+ +
+ +
+
+ +
+

hasError()

+ +
hasError() : boolean
+

Get the cuirrent error status of the form.

+ + + + + +

Returns

+ boolean +
+
+ +
+ +
+
+ +
+

setErrorMessage()

+ +
setErrorMessage(\Thelia\Form\unknown $message)
+

Set the error message related to global form error

+ + + +

Parameters

+ + + + + + +
\Thelia\Form\unknown$message +
+ + +
+
+ +
+ +
+
+ +
+

getErrorMessage()

+ +
getErrorMessage() : string
+

Get the form error message.

+ + + + + +

Returns

+ string +
+
+ +
+ +
+
+ +
+

getForm()

+ +
getForm() : \Symfony\Component\Form\Form
+

+ + + + + +

Returns

+ \Symfony\Component\Form\Form +
+
+ +
+ +
+
+ +
+

buildForm()

+ +
buildForm() : null
+

in this function you add all the fields you need for your Form.

+

Form this you have to call add method on $this->formBuilder attribute :

+ +

$this->formBuilder->add("name", "text") + ->add("email", "email", array( + "attr" => array( + "class" => "field" + ), + "label" => "email", + "constraints" => array( + new \Symfony\Component\Validator\Constraints\NotBlank() + ) + ) + ) + ->add('age', 'integer');

+ + + + +

Returns

+ null +
+
+ +
+ +
+
+ +
+

cleanOptions()

+ +
cleanOptions( $options)
+

+ + + +

Parameters

+ + + + + + +
$options +
+ + +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/documentation/api/classes/Thelia.Form.CategoryDeletionForm.html b/documentation/api/classes/Thelia.Form.CategoryDeletionForm.html new file mode 100644 index 000000000..1c71a632b --- /dev/null +++ b/documentation/api/classes/Thelia.Form.CategoryDeletionForm.html @@ -0,0 +1,2339 @@ + + + + + + API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\Thelia\FormCategoryDeletionForm

+

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ getName()
+ __construct()
+ getRequest()
+ getSuccessUrl()
+ createView()
+ getView()
+ setError()
+ hasError()
+ setErrorMessage()
+ getErrorMessage()
+ getForm()
+
+
+ No public properties found +
+
+ No constants found +
+
+
+
+ buildForm()
+ cleanOptions()
+
+
+ $formBuilder
+ $form
+ $request
+
+
+ N/A +
+
+
+
+ No private methods found +
+
+ $view
+ $has_error
+ $error_message
+
+
+ N/A +
+
+
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$formBuilder

+
$formBuilder : \Symfony\Component\Form\FormFactoryInterface
+

+ + + +

Type

+ \Symfony\Component\Form\FormFactoryInterface +
+
+ +
+ +
+
+ +
+

$form

+
$form : \Symfony\Component\Form\Form
+

+ + + +

Type

+ \Symfony\Component\Form\Form +
+
+ +
+ +
+
+ +
+

$request

+
$request
+

+ + + +
+
+ +
+ +
+
+ +
+

$view

+
$view
+

+ + + +
+
+ +
+ +
+
+ +
+

$has_error

+
$has_error : boolean
+

true if the form has an error, false otherwise.

+ + + +

Type

+ boolean +
+
+ +
+ +
+
+ +
+

$error_message

+
$error_message : string
+

The form error message.

+ + + +

Type

+ string +
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

getName()

+ +
getName() : string
+

+ + + + + +

Returns

+ string + —

the name of you form. This name must be unique

+ +
+
+ +
+ +
+
+ +
+

__construct()

+ +
__construct(\Symfony\Component\HttpFoundation\Request $request,  $type,  $data,  $options)
+

+ + + +

Parameters

+ + + + + + + + + + + + + + + + + + + + + +
\Symfony\Component\HttpFoundation\Request$request +
$type +
$data +
$options +
+ + +
+
+ +
+ +
+
+ +
+

getRequest()

+ +
getRequest()
+

+ + + + + +
+
+ +
+ +
+
+ +
+

getSuccessUrl()

+ +
getSuccessUrl(string $default) : string
+

Returns the absolute URL to redirect the user to if the form is successfully processed.

+ + + +

Parameters

+ + + + + + +
string$default

the default URL. If not given, the configured base URL is used.

+
+ + +

Returns

+ string + —

an absolute URL

+ +
+
+ +
+ +
+
+ +
+

createView()

+ +
createView()
+

+ + + + + +
+
+ +
+ +
+
+ +
+

getView()

+ +
getView()
+

+ + + + + +
+
+ +
+ +
+
+ +
+

setError()

+ +
setError(boolean $has_error)
+

Set the error status of the form.

+ + + +

Parameters

+ + + + + + +
boolean$has_error +
+ + +
+
+ +
+ +
+
+ +
+

hasError()

+ +
hasError() : boolean
+

Get the cuirrent error status of the form.

+ + + + + +

Returns

+ boolean +
+
+ +
+ +
+
+ +
+

setErrorMessage()

+ +
setErrorMessage(\Thelia\Form\unknown $message)
+

Set the error message related to global form error

+ + + +

Parameters

+ + + + + + +
\Thelia\Form\unknown$message +
+ + +
+
+ +
+ +
+
+ +
+

getErrorMessage()

+ +
getErrorMessage() : string
+

Get the form error message.

+ + + + + +

Returns

+ string +
+
+ +
+ +
+
+ +
+

getForm()

+ +
getForm() : \Symfony\Component\Form\Form
+

+ + + + + +

Returns

+ \Symfony\Component\Form\Form +
+
+ +
+ +
+
+ +
+

buildForm()

+ +
buildForm() : null
+

in this function you add all the fields you need for your Form.

+

Form this you have to call add method on $this->formBuilder attribute :

+ +

$this->formBuilder->add("name", "text") + ->add("email", "email", array( + "attr" => array( + "class" => "field" + ), + "label" => "email", + "constraints" => array( + new \Symfony\Component\Validator\Constraints\NotBlank() + ) + ) + ) + ->add('age', 'integer');

+ + + + +

Returns

+ null +
+
+ +
+ +
+
+ +
+

cleanOptions()

+ +
cleanOptions( $options)
+

+ + + +

Parameters

+ + + + + + +
$options +
+ + +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/documentation/api/classes/Thelia.Type.BooleanOrBothType.html b/documentation/api/classes/Thelia.Type.BooleanOrBothType.html new file mode 100644 index 000000000..1ee59083b --- /dev/null +++ b/documentation/api/classes/Thelia.Type.BooleanOrBothType.html @@ -0,0 +1,1834 @@ + + + + + + API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\Thelia\TypeBooleanOrBothType

+

This filter accepts either a boolean value, or '*' which means both, true and false

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ getType()
+ isValid()
+ getFormattedValue()
+
+
+ No public properties found +
+
+ ANY
+
+
+
+
+ No protected methods found +
+
+ No protected properties found +
+
+ N/A +
+
+
+
+ No private methods found +
+
+ No private properties found +
+
+ N/A +
+
+
+
+ +
+ + +
+
+

Constants

+
+ +
+ +
+
+ +
+

ANY

+
ANY
+

+ + +
+
+ +
+ + + + +
+

Methods

+ +
+ +
+
+ +
+

getType()

+ +
getType()
+

+ + + + + +
+
+ +
+ +
+
+ +
+

isValid()

+ +
isValid( $value)
+

+ + + +

Parameters

+ + + + + + +
$value +
+ + +
+
+ +
+ +
+
+ +
+

getFormattedValue()

+ +
getFormattedValue( $value)
+

+ + + +

Parameters

+ + + + + + +
$value +
+ + +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/documentation/api/files/Action.Category.php.html b/documentation/api/files/Action.Category.php.html new file mode 100644 index 000000000..7d321a48f --- /dev/null +++ b/documentation/api/files/Action.Category.php.html @@ -0,0 +1,1645 @@ + + + + + + API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

ActionCategory.php

+

+ + + + + +

Classes

+ + + + + +
Category
+
+ + +
+ + + +
+
+ + + + +
+ + + diff --git a/documentation/api/files/Action.Exception.FormValidationException.php.html b/documentation/api/files/Action.Exception.FormValidationException.php.html new file mode 100644 index 000000000..8f7f6c8e4 --- /dev/null +++ b/documentation/api/files/Action.Exception.FormValidationException.php.html @@ -0,0 +1,1645 @@ + + + + + + API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

Action/ExceptionFormValidationException.php

+

+ + + + + +

Classes

+ + + + + +
FormValidationException
+
+ + +
+ + + +
+
+ + + + +
+ + + diff --git a/documentation/api/files/Action/Category.php.txt b/documentation/api/files/Action/Category.php.txt new file mode 100644 index 000000000..bac17bb50 --- /dev/null +++ b/documentation/api/files/Action/Category.php.txt @@ -0,0 +1,254 @@ +. */ +/* */ +/*************************************************************************************/ + +namespace Thelia\Action; + +use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Thelia\Core\Event\ActionEvent; +use Thelia\Core\Event\TheliaEvents; +use Thelia\Model\Category as CategoryModel; +use Thelia\Form\CategoryCreationForm; +use Thelia\Core\Event\CategoryEvent; +use Thelia\Tools\Redirect; +use Thelia\Model\CategoryQuery; +use Thelia\Model\AdminLog; +use Thelia\Form\CategoryDeletionForm; +use Thelia\Action\Exception\FormValidationException; + +class Category extends BaseAction implements EventSubscriberInterface +{ + public function create(ActionEvent $event) + { + $request = $event->getRequest(); + + try { + $categoryCreationForm = new CategoryCreationForm($request); + + $form = $this->validateForm($categoryCreationForm, "POST"); + + $data = $form->getData(); + + $category = new CategoryModel(); + + $event->getDispatcher()->dispatch(TheliaEvents::BEFORE_CREATECATEGORY, $event); + + $category->create( + $data["title"], + $data["parent"], + $data["locale"] + ); + + AdminLog::append(sprintf("Category %s (ID %s) created", $category->getTitle(), $category->getId()), $request, $request->getSession()->getAdminUser()); + + $categoryEvent = new CategoryEvent($category); + + $event->getDispatcher()->dispatch(TheliaEvents::AFTER_CREATECATEGORY, $categoryEvent); + + // Substitute _ID_ in the URL with the ID of the created category + $successUrl = str_replace('_ID_', $category->getId(), $categoryCreationForm->getSuccessUrl()); + + // Redirect to the success URL + Redirect::exec($successUrl); + + } catch (PropelException $e) { + Tlog::getInstance()->error(sprintf('error during creating category with message "%s"', $e->getMessage())); + + $message = "Failed to create this category, please try again."; + } + + // The form has errors, propagate it. + $this->propagateFormError($categoryCreationForm, $message, $event); + } + + public function modify(ActionEvent $event) + { + /* + $request = $event->getRequest(); + + $customerModification = new CustomerModification($request); + + $form = $customerModification->getForm(); + + if ($request->isMethod("post")) { + + $form->bind($request); + + if ($form->isValid()) { + $data = $form->getData(); + + $customer = CustomerQuery::create()->findPk(1); + try { + $customerEvent = new CustomerEvent($customer); + $event->getDispatcher()->dispatch(TheliaEvents::BEFORE_CHANGECUSTOMER, $customerEvent); + + $data = $form->getData(); + + $customer->createOrUpdate( + $data["title"], + $data["firstname"], + $data["lastname"], + $data["address1"], + $data["address2"], + $data["address3"], + $data["phone"], + $data["cellphone"], + $data["zipcode"], + $data["country"] + ); + + $customerEvent->customer = $customer; + $event->getDispatcher()->dispatch(TheliaEvents::AFTER_CHANGECUSTOMER, $customerEvent); + + // Update the logged-in user, and redirect to the success URL (exits) + // We don-t send the login event, as the customer si already logged. + $this->processSuccessfullLogin($event, $customer, $customerModification); + } + catch(PropelException $e) { + + Tlog::getInstance()->error(sprintf('error during modifying customer on action/modifyCustomer with message "%s"', $e->getMessage())); + + $message = "Failed to change your account, please try again."; + } + } + else { + $message = "Missing or invalid data"; + } + } + else { + $message = "Wrong form method !"; + } + + // The form has an error + $customerModification->setError(true); + $customerModification->setErrorMessage($message); + + // Dispatch the errored form + $event->setErrorForm($customerModification); + */ + } + + /** + * Delete a category + * + * @param ActionEvent $event + */ + public function delete(ActionEvent $event) + { + $request = $event->getRequest(); + + try { + $categoryDeletionForm = new CategoryDeletionForm($request); + + $form = $this->validateForm($categoryDeletionForm, "POST"); + + $data = $form->getData(); + + $category = CategoryQuery::create()->findPk($data['id']); + + $categoryEvent = new CategoryEvent($category); + + $event->getDispatcher()->dispatch(TheliaEvents::BEFORE_DELETECATEGORY, $categoryEvent); + + $category->delete(); + + AdminLog::append(sprintf("Category %s (ID %s) deleted", $category->getTitle(), $category->getId()), $request, $request->getSession()->getAdminUser()); + + $categoryEvent->category = $category; + + $event->getDispatcher()->dispatch(TheliaEvents::AFTER_DELETECATEGORY, $categoryEvent); + + // Substitute _ID_ in the URL with the ID of the created category + $successUrl = str_replace('_ID_', $category->getParent(), $categoryDeletionForm->getSuccessUrl()); + + // Redirect to the success URL + Redirect::exec($successUrl); + } + catch(PropelException $e) { + + Tlog::getInstance()->error(sprintf('error during deleting category ID=%s on action/modifyCustomer with message "%s"', $data['id'], $e->getMessage())); + + $message = "Failed to change your account, please try again."; + } + catch(FormValidationException $e) { + + $message = $e->getMessage(); + } + + $this->propagateFormError($categoryDeletionForm, $message, $event); + } + + /** + * Toggle category visibility. No form used here + * + * @param ActionEvent $event + */ + public function toggleVisibility(ActionEvent $event) + { + $request = $event->getRequest(); + + $category = CategoryQuery::create()->findPk($request->get('id', 0)); + + if ($category !== null) { + + $category->setVisible($category->getVisible() ? false : true); + + $category->save(); + + $categoryEvent = new CategoryEvent($category); + + $event->getDispatcher()->dispatch(TheliaEvents::AFTER_CHANGECATEGORY, $categoryEvent); + } + } + + /** + * Returns an array of event names this subscriber listens to. + * + * The array keys are event names and the value can be: + * + * * The method name to call (priority defaults to 0) + * * An array composed of the method name to call and the priority + * * An array of arrays composed of the method names to call and respective + * priorities, or 0 if unset + * + * For instance: + * + * * array('eventName' => 'methodName') + * * array('eventName' => array('methodName', $priority)) + * * array('eventName' => array(array('methodName1', $priority), array('methodName2')) + * + * @return array The event names to listen to + * + * @api + */ + public static function getSubscribedEvents() + { + return array( + "action.createCategory" => array("create", 128), + "action.modifyCategory" => array("modify", 128), + "action.deleteCategory" => array("delete", 128), + + "action.toggleCategoryVisibility" => array("toggleVisibility", 128), + ); + } +} + diff --git a/documentation/api/files/Action/Exception/FormValidationException.php.txt b/documentation/api/files/Action/Exception/FormValidationException.php.txt new file mode 100644 index 000000000..76886a3d9 --- /dev/null +++ b/documentation/api/files/Action/Exception/FormValidationException.php.txt @@ -0,0 +1,29 @@ +. */ +/* */ +/*************************************************************************************/ + +namespace Thelia\Action\Exception; + + +class FormValidationException extends ActionException +{ +} diff --git a/documentation/api/files/Cart.CartTrait.php.html b/documentation/api/files/Cart.CartTrait.php.html new file mode 100644 index 000000000..b928abad6 --- /dev/null +++ b/documentation/api/files/Cart.CartTrait.php.html @@ -0,0 +1,1645 @@ + + + + + + API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

CartCartTrait.php

+

+ + + +

Traits

+ + + + + +
CartTrait
+ + +
+ + +
+ + + +
+
+ + + + +
+ + + diff --git a/documentation/api/files/Cart/CartTrait.php.txt b/documentation/api/files/Cart/CartTrait.php.txt new file mode 100644 index 000000000..472275c33 --- /dev/null +++ b/documentation/api/files/Cart/CartTrait.php.txt @@ -0,0 +1,138 @@ +. */ +/* */ +/*************************************************************************************/ +namespace Thelia\Cart; + +use Thelia\Model\ProductPrice; +use Thelia\Model\ProductPriceQuery; +use Thelia\Model\CartItem; +use Thelia\Model\CartItemQuery; +use Thelia\Model\CartQuery; +use Thelia\Model\Cart as CartModel; +use Thelia\Model\ConfigQuery; +use Thelia\Model\Customer; +use Symfony\Component\HttpFoundation\Request; +use Thelia\Core\HttpFoundation\Session\Session; +use Thelia\Core\Event\CartEvent; +use Thelia\Core\Event\TheliaEvents; + +trait CartTrait { + /** + * + * search if cart already exists in session. If not try to create a new one or duplicate an old one. + * + * @param \Symfony\Component\HttpFoundation\Request $request + * @return \Thelia\Model\Cart + */ + public function getCart(Request $request) + { + + if(null !== $cart = $request->getSession()->getCart()){ + return $cart; + } + + if ($request->cookies->has("thelia_cart")) { + //le cookie de panier existe, on le récupère + $token = $request->cookies->get("thelia_cart"); + + $cart = CartQuery::create()->findOneByToken($token); + + if ($cart) { + //le panier existe en base + $customer = $request->getSession()->getCustomerUser(); + + if ($customer) { + if($cart->getCustomerId() != $customer->getId()) { + //le customer du panier n'est pas le mm que celui connecté, il faut cloner le panier sans le customer_id + $cart = $this->duplicateCart($cart, $request->getSession(), $customer); + } + } else { + if ($cart->getCustomerId() != null) { + //il faut dupliquer le panier sans le customer_id + $cart = $this->duplicateCart($cart, $request->getSession()); + } + } + + } else { + $cart = $this->createCart($request->getSession()); + } + } else { + //le cookie de panier n'existe pas, il va falloir le créer et faire un enregistrement en base. + $cart = $this->createCart($request->getSession()); + } + + return $cart; + } + + /** + * @param \Thelia\Core\HttpFoundation\Session\Session $session + * @return \Thelia\Model\Cart + */ + protected function createCart(Session $session) + { + $cart = new CartModel(); + $cart->setToken($this->generateCookie()); + + if(null !== $customer = $session->getCustomerUser()) { + $cart->setCustomer($customer); + } + + $cart->save(); + + $session->setCart($cart->getId()); + + return $cart; + } + + + /** + * try to duplicate existing Cart. Customer is here to determine if this cart belong to him. + * + * @param \Thelia\Model\Cart $cart + * @param \Thelia\Core\HttpFoundation\Session\Session $session + * @param \Thelia\Model\Customer $customer + * @return \Thelia\Model\Cart + */ + protected function duplicateCart(CartModel $cart, Session $session, Customer $customer = null) + { + $newCart = $cart->duplicate($this->generateCookie(), $customer); + $session->setCart($newCart->getId()); + + $cartEvent = new CartEvent($newCart); + $this->dispatcher->dispatch(TheliaEvents::CART_DUPLICATE, $cartEvent); + + return $cartEvent->cart; + } + + protected function generateCookie() + { + $id = null; + if (ConfigQuery::read("cart.session_only", 0) == 0) { + $id = uniqid('', true); + setcookie("thelia_cart", $id, time()+ConfigQuery::read("cart.cookie_lifetime", 60*60*24*365)); + + } + + return $id; + + } +} diff --git a/documentation/api/files/Core.Event.CategoryEvent.php.html b/documentation/api/files/Core.Event.CategoryEvent.php.html new file mode 100644 index 000000000..4b329954e --- /dev/null +++ b/documentation/api/files/Core.Event.CategoryEvent.php.html @@ -0,0 +1,1645 @@ + + + + + + API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

Core/EventCategoryEvent.php

+

+ + + + + +

Classes

+ + + + + +
CategoryEventBase class used for internal event like creating new Customer, adding item to cart, etc
+
+ + +
+ + + +
+
+ + + + +
+ + + diff --git a/documentation/api/files/Core.Security.Exception.AuthorizationException.php.html b/documentation/api/files/Core.Security.Exception.AuthorizationException.php.html new file mode 100644 index 000000000..cc498de15 --- /dev/null +++ b/documentation/api/files/Core.Security.Exception.AuthorizationException.php.html @@ -0,0 +1,1645 @@ + + + + + + API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

Core/Security/ExceptionAuthorizationException.php

+

+ + + + + +

Classes

+ + + + + +
AuthorizationException
+
+ + +
+ + + +
+
+ + + + +
+ + + diff --git a/documentation/api/files/Core.Template.Loop.CategoryTree.php.html b/documentation/api/files/Core.Template.Loop.CategoryTree.php.html new file mode 100644 index 000000000..6420c6e9b --- /dev/null +++ b/documentation/api/files/Core.Template.Loop.CategoryTree.php.html @@ -0,0 +1,1645 @@ + + + + + + API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

Core/Template/LoopCategoryTree.php

+

+ + + + + +

Classes

+ + + + + +
CategoryTreeCategory tree loop, to get a category tree from a given category to a given depth.
+
+ + +
+ + + +
+
+ + + + +
+ + + diff --git a/documentation/api/files/Core.Template.Loop.Lang.php.html b/documentation/api/files/Core.Template.Loop.Lang.php.html new file mode 100644 index 000000000..ba2331273 --- /dev/null +++ b/documentation/api/files/Core.Template.Loop.Lang.php.html @@ -0,0 +1,1645 @@ + + + + + + API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

Core/Template/LoopLang.php

+

+ + + + + +

Classes

+ + + + + +
LangLanguage loop, to get a list of available languages
+
+ + +
+ + + +
+
+ + + + +
+ + + diff --git a/documentation/api/files/Core/Event/CategoryEvent.php.txt b/documentation/api/files/Core/Event/CategoryEvent.php.txt new file mode 100644 index 000000000..b674bf787 --- /dev/null +++ b/documentation/api/files/Core/Event/CategoryEvent.php.txt @@ -0,0 +1,37 @@ +. */ +/* */ +/*************************************************************************************/ + +namespace Thelia\Core\Event; + + +use Thelia\Model\Category; + +class CategoryEvent extends InternalEvent { + + public $category; + + public function __construct(Category $category) + { + $this->category = $category; + } +} diff --git a/documentation/api/files/Core/Security/Exception/AuthorizationException.php.txt b/documentation/api/files/Core/Security/Exception/AuthorizationException.php.txt new file mode 100644 index 000000000..9ca33d89d --- /dev/null +++ b/documentation/api/files/Core/Security/Exception/AuthorizationException.php.txt @@ -0,0 +1,29 @@ +. */ +/* */ +/*************************************************************************************/ + +namespace Thelia\Core\Security\Exception; + +class AuthorizationException extends \Exception +{ +} + diff --git a/documentation/api/files/Core/Template/Loop/CategoryTree.php.txt b/documentation/api/files/Core/Template/Loop/CategoryTree.php.txt new file mode 100644 index 000000000..1bc7e008e --- /dev/null +++ b/documentation/api/files/Core/Template/Loop/CategoryTree.php.txt @@ -0,0 +1,123 @@ +. */ +/* */ +/*************************************************************************************/ + +namespace Thelia\Core\Template\Loop; + +use Propel\Runtime\ActiveQuery\Criteria; +use Thelia\Core\Template\Element\BaseLoop; +use Thelia\Core\Template\Element\LoopResult; +use Thelia\Core\Template\Element\LoopResultRow; + +use Thelia\Core\Template\Loop\Argument\ArgumentCollection; +use Thelia\Core\Template\Loop\Argument\Argument; +use Thelia\Log\Tlog; + +use Thelia\Model\CategoryQuery; +use Thelia\Model\ConfigQuery; +use Thelia\Type\TypeCollection; +use Thelia\Type; +use Thelia\Type\BooleanOrBothType; + +/** + * + * Category tree loop, to get a category tree from a given category to a given depth. + * + * - category is the category id + * - depth is the maximum depth to go, default unlimited + * - visible if true or missing, only visible categories will be displayed. If false, all categories (visible or not) are returned. + * + * @package Thelia\Core\Template\Loop + * @author Franck Allimant + */ +class CategoryTree extends BaseLoop +{ + /** + * @return ArgumentCollection + */ + protected function getArgDefinitions() + { + return new ArgumentCollection( + Argument::createIntTypeArgument('category', null, true), + Argument::createIntTypeArgument('depth', PHP_INT_MAX), + Argument::createBooleanOrBothTypeArgument('visible', true, false), + Argument::createIntListTypeArgument('exclude', array()) + ); + } + + // changement de rubrique + protected function buildCategoryTree($parent, $visible, $level, $max_level, array $exclude, LoopResult &$loopResult) { + + if ($level > $max_level) return; + + $search = CategoryQuery::create(); + + $search->filterByParent($parent); + + if ($visible != BooleanOrBothType::ANY) $search->filterByVisible($visible); + + $search->filterById($exclude, Criteria::NOT_IN); + + $search->orderByPosition(Criteria::ASC); + + $results = $search->find(); + + foreach($results as $result) { + + $loopResultRow = new LoopResultRow(); + + $loopResultRow + ->set("ID", $result->getId()) + ->set("TITLE",$result->getTitle()) + ->set("PARENT", $result->getParent()) + ->set("URL", $result->getUrl()) + ->set("VISIBLE", $result->getVisible() ? "1" : "0") + ->set("LEVEL", $level) + ; + + $loopResult->addRow($loopResultRow); + + $this->buildCategoryTree($result->getId(), $visible, 1 + $level, $max_level, $exclude, $loopResult); + } + } + + /** + * @param $pagination (ignored) + * + * @return \Thelia\Core\Template\Element\LoopResult + */ + public function exec(&$pagination) + { + $id = $this->getCategory(); + $depth = $this->getDepth(); + $visible = $this->getVisible(); + $exclude = $this->getExclude(); + + //echo "exclude=".print_r($exclude); + + $loopResult = new LoopResult(); + + $this->buildCategoryTree($id, $visible, 0, $depth, $exclude, $loopResult); + + return $loopResult; + } +} diff --git a/documentation/api/files/Core/Template/Loop/Lang.php.txt b/documentation/api/files/Core/Template/Loop/Lang.php.txt new file mode 100644 index 000000000..f75558266 --- /dev/null +++ b/documentation/api/files/Core/Template/Loop/Lang.php.txt @@ -0,0 +1,114 @@ +. */ +/* */ +/*************************************************************************************/ + +namespace Thelia\Core\Template\Loop; + +use Propel\Runtime\ActiveQuery\Criteria; +use Thelia\Core\Template\Element\BaseLoop; +use Thelia\Core\Template\Element\LoopResult; +use Thelia\Core\Template\Element\LoopResultRow; + +use Thelia\Core\Template\Loop\Argument\Argument; + +use Thelia\Type\TypeCollection; +use Thelia\Type; +use Thelia\Model\LangQuery; +use Thelia\Core\Template\Loop\Argument\ArgumentCollection; + +/** + * 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 + * + * @package Thelia\Core\Template\Loop + * @author Franck Allimant + */ +class Lang extends BaseLoop +{ + /** + * @return ArgumentCollection + */ + protected function getArgDefinitions() + { + return new ArgumentCollection( + Argument::createIntTypeArgument('id', null), + Argument::createIntListTypeArgument('exclude'), + Argument::createBooleanTypeArgument('default_only', false) + ); + } + + /** + * @param $pagination (ignored) + * + * @return \Thelia\Core\Template\Element\LoopResult + */ + public function exec(&$pagination) + { + $id = $this->getId(); + $exclude = $this->getExclude(); + $default_only = $this->getDefaultOnly(); + + $search = LangQuery::create(); + + if (! is_null($id)) + $search->filterById($id); + + if ($default_only) + $search->filterByByDefault(true); + + if (! is_null($exclude)) { + $search->filterById($exclude, Criteria::NOT_IN); + } + + $search->orderByPosition(Criteria::ASC); + + $results = $this->search($search, $pagination); + + $loopResult = new LoopResult(); + + foreach ($results as $result) { + + $loopResultRow = new LoopResultRow(); + + $loopResultRow + ->set("ID", $result->getId()) + ->set("TITLE",$result->getTitle()) + ->set("CODE", $result->getCode()) + ->set("LOCALE", $result->getLocale()) + ->set("URL", $result->getUrl()) + ->set("IS_DEFAULT", $result->getByDefault()) + ->set("URL", $result->getUrl()) + ->set("POSITION", $result->getPosition()) + + ->set("CREATE_DATE", $result->getCreatedAt()) + ->set("UPDATE_DATE", $result->getUpdatedAt()) + ; + + $loopResult->addRow($loopResultRow); + } + + return $loopResult; + } +} diff --git a/documentation/api/files/Form.CategoryCreationForm.php.html b/documentation/api/files/Form.CategoryCreationForm.php.html new file mode 100644 index 000000000..93f90c758 --- /dev/null +++ b/documentation/api/files/Form.CategoryCreationForm.php.html @@ -0,0 +1,1645 @@ + + + + + + API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

FormCategoryCreationForm.php

+

+ + + + + +

Classes

+ + + + + +
CategoryCreationForm
+
+ + +
+ + + +
+
+ + + + +
+ + + diff --git a/documentation/api/files/Form.CategoryDeletionForm.php.html b/documentation/api/files/Form.CategoryDeletionForm.php.html new file mode 100644 index 000000000..9d8a9a1e8 --- /dev/null +++ b/documentation/api/files/Form.CategoryDeletionForm.php.html @@ -0,0 +1,1645 @@ + + + + + + API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

FormCategoryDeletionForm.php

+

+ + + + + +

Classes

+ + + + + +
CategoryDeletionForm
+
+ + +
+ + + +
+
+ + + + +
+ + + diff --git a/documentation/api/files/Form/CategoryCreationForm.php.txt b/documentation/api/files/Form/CategoryCreationForm.php.txt new file mode 100644 index 000000000..722c8873c --- /dev/null +++ b/documentation/api/files/Form/CategoryCreationForm.php.txt @@ -0,0 +1,56 @@ +. */ +/* */ +/*************************************************************************************/ +namespace Thelia\Form; + +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Validator\Constraints\NotBlank; + +class CategoryCreationForm extends BaseForm { + + protected function buildForm() + { + $this->formBuilder + ->add("title", "text", array( + "constraints" => array( + new NotBlank() + ) + )) + ->add("parent", "integer", array( + "constraints" => array( + new NotBlank() + ) + )) + ->add("locale", "text", array( + "constraints" => array( + new NotBlank() + ) + )) + ; + } + + public function getName() + { + return "thelia_category_creation"; + } +} + diff --git a/documentation/api/files/Form/CategoryDeletionForm.php.txt b/documentation/api/files/Form/CategoryDeletionForm.php.txt new file mode 100644 index 000000000..2ee2a2f78 --- /dev/null +++ b/documentation/api/files/Form/CategoryDeletionForm.php.txt @@ -0,0 +1,45 @@ +. */ +/* */ +/*************************************************************************************/ +namespace Thelia\Form; + +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Validator\Constraints\NotBlank; + +class CategoryDeletionForm extends BaseForm { + + protected function buildForm() + { + $this->formBuilder + ->add("id", "integer", array( + "constraints" => array( + new NotBlank() + ) + )) + ; + } + + public function getName() + { + return "thelia_category_deletion"; + } +} diff --git a/documentation/api/files/Type.BooleanOrBothType.php.html b/documentation/api/files/Type.BooleanOrBothType.php.html new file mode 100644 index 000000000..640358169 --- /dev/null +++ b/documentation/api/files/Type.BooleanOrBothType.php.html @@ -0,0 +1,1645 @@ + + + + + + API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

TypeBooleanOrBothType.php

+

+ + + + + +

Classes

+ + + + + +
BooleanOrBothTypeThis filter accepts either a boolean value, or '*' which means both, true and false
+
+ + +
+ + + +
+
+ + + + +
+ + + diff --git a/documentation/api/files/Type/BooleanOrBothType.php.txt b/documentation/api/files/Type/BooleanOrBothType.php.txt new file mode 100644 index 000000000..9e4447363 --- /dev/null +++ b/documentation/api/files/Type/BooleanOrBothType.php.txt @@ -0,0 +1,54 @@ +. */ +/* */ +/*************************************************************************************/ +namespace Thelia\Type; + +/** + * This filter accepts either a boolean value, or '*' which means both, true and false + * + * @author Etienne Roudeix + * + */ + +class BooleanOrBothType implements TypeInterface +{ + + const ANY = '*'; + + public function getType() + { + return 'Boolean or both type'; + } + + public function isValid($value) + { + return $value === self::ANY || filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE) !== null; + } + + public function getFormattedValue($value) + { + if ($value === self::ANY) return $value; + + return $value === null ? null : filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); + } +} + diff --git a/documentation/api/namespaces/Thelia.Cart.html b/documentation/api/namespaces/Thelia.Cart.html new file mode 100644 index 000000000..1bc0eccef --- /dev/null +++ b/documentation/api/namespaces/Thelia.Cart.html @@ -0,0 +1,1583 @@ + + + + + + API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ +

\TheliaCart

+ + +

Traits

+ + + + + +
CartTrait
+ + +
+ + +
+ + + +
+
+ + +
+ + + diff --git a/documentation/api/phpdoc-cache-0b/phpdoc-cache-file_32c9f993ba4d278f85efbdac57d30c1b.dat b/documentation/api/phpdoc-cache-0b/phpdoc-cache-file_32c9f993ba4d278f85efbdac57d30c1b.dat new file mode 100644 index 000000000..88792902f Binary files /dev/null and b/documentation/api/phpdoc-cache-0b/phpdoc-cache-file_32c9f993ba4d278f85efbdac57d30c1b.dat differ diff --git a/documentation/api/phpdoc-cache-21/phpdoc-cache-file_a3643b212d0a35c0dafbee9c2bbe2c11.dat b/documentation/api/phpdoc-cache-21/phpdoc-cache-file_a3643b212d0a35c0dafbee9c2bbe2c11.dat new file mode 100644 index 000000000..5877c3ae5 Binary files /dev/null and b/documentation/api/phpdoc-cache-21/phpdoc-cache-file_a3643b212d0a35c0dafbee9c2bbe2c11.dat differ diff --git a/documentation/api/phpdoc-cache-27/phpdoc-cache-file_c8d56734f26182bfc343d385509dbf36.dat b/documentation/api/phpdoc-cache-27/phpdoc-cache-file_c8d56734f26182bfc343d385509dbf36.dat new file mode 100644 index 000000000..99f05b7f8 Binary files /dev/null and b/documentation/api/phpdoc-cache-27/phpdoc-cache-file_c8d56734f26182bfc343d385509dbf36.dat differ diff --git a/documentation/api/phpdoc-cache-3d/phpdoc-cache-file_939af359fed33854bd55e59313ec017c.dat b/documentation/api/phpdoc-cache-3d/phpdoc-cache-file_939af359fed33854bd55e59313ec017c.dat new file mode 100644 index 000000000..97bc6c42c Binary files /dev/null and b/documentation/api/phpdoc-cache-3d/phpdoc-cache-file_939af359fed33854bd55e59313ec017c.dat differ diff --git a/documentation/api/phpdoc-cache-4e/phpdoc-cache-file_94ccf1d6684f73c94414e65b98169089.dat b/documentation/api/phpdoc-cache-4e/phpdoc-cache-file_94ccf1d6684f73c94414e65b98169089.dat new file mode 100644 index 000000000..01f7a0008 Binary files /dev/null and b/documentation/api/phpdoc-cache-4e/phpdoc-cache-file_94ccf1d6684f73c94414e65b98169089.dat differ diff --git a/documentation/api/phpdoc-cache-82/phpdoc-cache-file_e66020f7c2728bce96a786b7f43edff3.dat b/documentation/api/phpdoc-cache-82/phpdoc-cache-file_e66020f7c2728bce96a786b7f43edff3.dat new file mode 100644 index 000000000..b1a0954de Binary files /dev/null and b/documentation/api/phpdoc-cache-82/phpdoc-cache-file_e66020f7c2728bce96a786b7f43edff3.dat differ diff --git a/documentation/api/phpdoc-cache-95/phpdoc-cache-file_f312c17e13b5538730814011faa2fe1f.dat b/documentation/api/phpdoc-cache-95/phpdoc-cache-file_f312c17e13b5538730814011faa2fe1f.dat new file mode 100644 index 000000000..f79eeebcc Binary files /dev/null and b/documentation/api/phpdoc-cache-95/phpdoc-cache-file_f312c17e13b5538730814011faa2fe1f.dat differ diff --git a/documentation/api/phpdoc-cache-a8/phpdoc-cache-file_438820914076c4c0d905b34ead653b6a.dat b/documentation/api/phpdoc-cache-a8/phpdoc-cache-file_438820914076c4c0d905b34ead653b6a.dat new file mode 100644 index 000000000..4a3565d4a Binary files /dev/null and b/documentation/api/phpdoc-cache-a8/phpdoc-cache-file_438820914076c4c0d905b34ead653b6a.dat differ diff --git a/documentation/api/phpdoc-cache-b6/phpdoc-cache-file_c6121287de320bb66016b1b65e250000.dat b/documentation/api/phpdoc-cache-b6/phpdoc-cache-file_c6121287de320bb66016b1b65e250000.dat new file mode 100644 index 000000000..5b7d9ed4e Binary files /dev/null and b/documentation/api/phpdoc-cache-b6/phpdoc-cache-file_c6121287de320bb66016b1b65e250000.dat differ diff --git a/documentation/api/phpdoc-cache-c8/phpdoc-cache-file_0a0e3d29d89033abec119857e1df20bc.dat b/documentation/api/phpdoc-cache-c8/phpdoc-cache-file_0a0e3d29d89033abec119857e1df20bc.dat new file mode 100644 index 000000000..fe1d5cbc2 Binary files /dev/null and b/documentation/api/phpdoc-cache-c8/phpdoc-cache-file_0a0e3d29d89033abec119857e1df20bc.dat differ