RMS\PushNotificationsBundle\Service\OS\AppleNotification::__construct PHP Метод

__construct() публичный Метод

Constructor
public __construct ( boolean $sandbox, string $pem, string $passphrase = "", boolean $jsonUnescapedUnicode = FALSE, integer $timeout = 60, string $cachedir = "", RMS\PushNotificationsBundle\Service\EventListener $eventListener = null, Psr\Log\LoggerInterface $logger = null )
$sandbox boolean
$pem string
$passphrase string
$jsonUnescapedUnicode boolean
$timeout integer
$cachedir string
$eventListener RMS\PushNotificationsBundle\Service\EventListener
$logger Psr\Log\LoggerInterface
    public function __construct($sandbox, $pem, $passphrase = "", $jsonUnescapedUnicode = FALSE, $timeout = 60, $cachedir = "", EventListener $eventListener = null, $logger = null)
    {
        $this->useSandbox = $sandbox;
        $this->pemPath = $pem;
        $this->passphrase = $passphrase;
        $this->apnStreams = array();
        $this->messages = array();
        $this->lastMessageId = -1;
        $this->jsonUnescapedUnicode = $jsonUnescapedUnicode;
        $this->timeout = $timeout;
        $this->cachedir = $cachedir;
        $this->logger = $logger;
        if ($eventListener != null) {
            $eventListener->addListener($this);
        }
    }

Usage Example

Пример #1
0
 public function __construct($container)
 {
     $logger = $container->get('logger');
     $em = $container->get('doctrine')->getManager();
     $appId = $container->get('keosu_core.curapp')->getCurApp();
     $app = $em->getRepository('KeosuCoreBundle:App')->find($appId);
     $iosSandbox = $app->getConfigPackages()[KeosuGadgetPushNotificationBundle::PACKAGE_NAME]['iosSandbox'];
     $iosPassPhrase = $app->getConfigPackages()[KeosuGadgetPushNotificationBundle::PACKAGE_NAME]['iosPassPhrase'];
     $iosPem = $app->getConfigPackages()[KeosuGadgetPushNotificationBundle::PACKAGE_NAME]['iosPem'];
     if (!is_file($iosPem)) {
         throw new \LogicException('Can\'t send message because ios pem file isn\'t uploaded');
     }
     parent::__construct($iosSandbox, $iosPem, $iosPassPhrase, false, 60, null, null, $logger);
 }