This commit is contained in:
Manuel Raynaud
2013-12-18 10:04:13 +01:00
parent d0e5d189d2
commit 2f4158d1f6
112 changed files with 425 additions and 526 deletions

View File

@@ -39,7 +39,6 @@ use Thelia\Model\Module;
use Thelia\Model\ModuleImage;
use Thelia\Model\ModuleQuery;
class BaseModule extends ContainerAware implements BaseModuleInterface
{
const CLASSIC_MODULE_TYPE = 1;
@@ -115,16 +114,18 @@ class BaseModule extends ContainerAware implements BaseModuleInterface
return $this->container;
}
public function hasRequest() {
public function hasRequest()
{
return null !== $this->request;
}
public function setRequest(Request $request) {
public function setRequest(Request $request)
{
$this->request = $request;
}
public function getRequest() {
public function getRequest()
{
if ($this->hasRequest() === false) {
throw new \RuntimeException("Sorry, the request is not available in this context");
}
@@ -132,16 +133,18 @@ class BaseModule extends ContainerAware implements BaseModuleInterface
return $this->request;
}
public function hasDispatcher() {
public function hasDispatcher()
{
return null !== $this->dispatcher;
}
public function setDispatcher(EventDispatcherInterface $dispatcher) {
public function setDispatcher(EventDispatcherInterface $dispatcher)
{
$this->dispatcher = $dispatcher;
}
public function getDispatcher() {
public function getDispatcher()
{
if ($this->hasDispatcher() === false) {
throw new \RuntimeException("Sorry, the dispatcher is not available in this context");
}
@@ -149,7 +152,6 @@ class BaseModule extends ContainerAware implements BaseModuleInterface
return $this->dispatcher;
}
public function setTitle(Module $module, $titles)
{
if (is_array($titles)) {
@@ -289,4 +291,4 @@ class BaseModule extends ContainerAware implements BaseModuleInterface
{
// Implement this method to do something useful.
}
}
}

View File

@@ -24,8 +24,6 @@
namespace Thelia\Module;
use Propel\Runtime\Connection\ConnectionInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\Request;
interface BaseModuleInterface
{