Completed
Push — master ( 76ac09...8c1d79 )
by Aimeos
04:15
created

AccountController::watchComponentAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/**
4
 * @license MIT, http://opensource.org/licenses/MIT
5
 * @copyright Aimeos (aimeos.org), 2014-2016
6
 * @package symfony
7
 * @subpackage Controller
8
 */
9
10
11
namespace Aimeos\ShopBundle\Controller;
12
13
use Symfony\Component\HttpFoundation\Response;
14
15
16
/**
17
 * Aimeos controller for account related functionality.
18
 *
19
 * @package symfony
20
 * @subpackage Controller
21
 */
22
class AccountController extends AbstractController
23
{
24
	/**
25
	 * Returns the html for the "My account" page.
26
	 *
27
	 * @return Response Response object containing the generated output
28
	 */
29
	public function indexAction()
30
	{
31
		$params = $this->get( 'aimeos_page' )->getSections( 'account-index' );
32
		return $this->render( 'AimeosShopBundle:Account:index.html.twig', $params );
33
	}
34
35
36
	/**
37
	 * Returns the html for the "My account" download page.
38
	 *
39
	 * @return Response Response object containing the generated output
40
	 */
41
	public function downloadAction()
42
	{
43
		$context = $this->container->get('aimeos_context')->get();
44
		$langid = $context->getLocale()->getLanguageId();
45
46
		$view = $this->container->get('aimeos_view')->create( $context, array(), $langid );
47
		$context->setView( $view );
48
49
		$client = \Aimeos\Client\Html\Factory::createClient( $context, array(), 'account/download' );
50
		$client->setView( $view );
51
		$client->process();
52
53
		$response = $view->response();
54
		return new Response( (string) $response->getBody(), $response->getStatusCode(), $response->getHeaders() );
55
	}
56
57
58
	/**
59
	 * Returns the output of the account favorite component
60
	 *
61
	 * @return Response Response object containing the generated output
62
	 */
63
	public function favoriteComponentAction()
64
	{
65
		return $this->getOutput( 'account/favorite' );
66
	}
67
68
69
	/**
70
	 * Returns the output of the account history component
71
	 *
72
	 * @return Response Response object containing the generated output
73
	 */
74
	public function historyComponentAction()
75
	{
76
		return $this->getOutput( 'account/history' );
77
	}
78
79
80
	/**
81
	 * Returns the output of the account watch component
82
	 *
83
	 * @return Response Response object containing the generated output
84
	 */
85
	public function watchComponentAction()
86
	{
87
		return $this->getOutput( 'account/watch' );
88
	}
89
}
90