| Current Path : /var/www/v3.cesa.co.za/src/CoreBundle/Services/ |
| Current File : /var/www/v3.cesa.co.za/src/CoreBundle/Services/ServiceGetterManager.php |
<?php
namespace App\CoreBundle\Services;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Mailer\MailerInterface;
use Twig\Environment;
use Monolog\Logger;
use MobileDetectBundle\DeviceDetector\MobileDetectorInterface;
/**
* Service Getter manager
*
* @author Otto Saayman <otto@igotafrica.com>
* @package CoreBundle
* @subpackage Service Getter
* @version 0.0.1
*/
final class ServiceGetterManager {
/**
* Service Container
* @var object
*/
private $container = null;
/**
* Mailer service
* @var object
*/
private $mailer = null;
/**
* Mailer service
* @var object
*/
private $mobileDetect = null;
protected $security;
protected $twig;
/**
* Class construct
*
* @param ContainerInterface $container
* @param Logger $logger
* @return void
*/
public function __construct(ContainerInterface $container, MobileDetectorInterface $mobileDetect, Security $security, Environment $twig, MailerInterface $mailer) {
$this->container = $container;
$this->mobileDetect = $mobileDetect;
$this->security = $security;
$this->twig = $twig;
$this->mailer = $mailer;
// $this->pwd_hasher = $passwordHasher;
}
/**
* Get Container
*
* @return ContainerInterface $container
*/
public function getContainer() {
return $this->container;
}
/**
* Set Container
*
* @param ContainerInterface $container
* @return void
*/
public function setContainer($container) {
$this->container = $container;
}
/**
* Get a service
*
* @param string $serviceName
* @return string
*/
public function get($serviceName) {
return $this->getContainer()->get($serviceName);
}
/**
* Get a service
*
* @param string $parameterName
* @return string
*/
public function getParameter($parameterName) {
return $this->getContainer()->getParameter($parameterName);
}
/**
* Get a service
*
* @return object
*/
public function getMailer() {
return $this->mailer;
}
/**
* Get a service
*
* @return object
*/
public function getMobileDetect() {
return $this->mobileDetect;
}
/**
* Get a service
*
* @return object
*/
public function getSecurity() {
return $this->security;
}
/**
* Get a service
*
* @return object
*/
public function getTwig() {
return $this->twig;
}
}