Mobile/Push/Message/Gcm.php

Show: PublicProtectedPrivateinherited
Table of Contents
Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Category
Zend  
Copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Mobile  
Subpackage
Zend_Mobile_Push  
Version
$Id$  

\Zend_Mobile_Push_Message_Gcm

Package: Zend\Mobile\Zend\Mobile\Push
Gcm Message
Parent(s)
\Zend_Mobile_Push_Message_Abstract
Category
Zend  
Copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Version
$Id$  

Properties

>VPropertyprotectedarray $_data = array()
Data key value pairs
Default valuearray()Details
Type
array
>VPropertyprotectedboolean $_delay = false
Delay while idle
Default valuefalseDetails
Type
boolean
>VPropertyprotected\scalar $_id
Details
Type
\scalar
Inherited_from
\Zend_Mobile_Push_Message_Abstract::$$_id  
>VPropertyprotectedarray $_token = array()
Tokens
Default valuearray()Details
Type
array
>VPropertyprotectedint $_ttl = 0
Time to live in seconds
Default value0Details
Type
int

Methods

methodpublicaddData(string $key, string $value) : \Zend_Mobile_Push_Message_Gcm

Add Data

Parameters
NameTypeDescription
$keystring
$valuestring
Returns
TypeDescription
\Zend_Mobile_Push_Message_Gcm
Throws
ExceptionDescription
\Zend_Mobile_Push_Message_Exception
methodpublicaddToken(string $token) : \Zend_Mobile_Push_Message_Gcm

Add a Token

Parameters
NameTypeDescription
$tokenstring
Returns
TypeDescription
\Zend_Mobile_Push_Message_Gcm
Throws
ExceptionDescription
\Zend_Mobile_Push_Message_Exception
methodpublicclearData() : \Zend_Mobile_Push_Message_Gcm

Clear Data

Returns
TypeDescription
\Zend_Mobile_Push_Message_Gcm
methodpublicclearToken() : \Zend_Mobile_Push_Message_Gcm

Clear Tokens

Returns
TypeDescription
\Zend_Mobile_Push_Message_Gcm
methodpublicgetData() : array

Get Data

Returns
TypeDescription
array
methodpublicgetDelayWhileIdle() : boolean

Get Delay While Idle

Returns
TypeDescription
boolean
methodpublicgetId() : \scalar
inherited

Get Message ID

Inherited from: \Zend_Mobile_Push_Message_Abstract::getId()
Returns
TypeDescription
\scalar
methodpublicgetToken() : string
inherited

Get Token

Inherited from: \Zend_Mobile_Push_Message_Abstract::getToken()
Returns
TypeDescription
string
methodpublicgetToken() : array

Returns
TypeDescription
array
Details
Magic
 
Method
 
methodpublicgetTtl() : int

Get time to live

Returns
TypeDescription
int
methodpublicsetData(array $data) : \Zend_Mobile_Push_Message_Gcm

Set Data

Parameters
NameTypeDescription
$dataarray
Returns
TypeDescription
\Zend_Mobile_Push_Message_Gcm
Throws
ExceptionDescription
\Zend_Mobile_Push_Message_Exception
methodpublicsetDelayWhileIdle(boolean $delay) : \Zend_Mobile_Push_Message_Gcm

Set Delay While Idle

Parameters
NameTypeDescription
$delayboolean
Returns
TypeDescription
\Zend_Mobile_Push_Message_Gcm
Throws
ExceptionDescription
\Zend_Mobile_Push_Message_Exception
methodpublicsetId(\scalar $id) : \Zend_Mobile_Push_Message_Abstract
inherited

Set Message ID

Inherited from: \Zend_Mobile_Push_Message_Abstract::setId()
Parameters
NameTypeDescription
$id\scalar
Returns
TypeDescription
\Zend_Mobile_Push_Message_Abstract
Throws
ExceptionDescription
\Exception
methodpublicsetOptions(array $options) : \Zend_Mobile_Push_Message_Abstract
inherited

Set Options

Inherited from: \Zend_Mobile_Push_Message_Abstract::setOptions()
Parameters
NameTypeDescription
$optionsarray
Returns
TypeDescription
\Zend_Mobile_Push_Message_Abstract
Throws
ExceptionDescription
\Zend_Mobile_Push_Message_Exception
methodpublicsetToken(string | array $token) : \Zend_Mobile_Push_Message_Gcm

Set Token

Parameters
NameTypeDescription
$tokenstring | array
Returns
TypeDescription
\Zend_Mobile_Push_Message_Gcm
Throws
ExceptionDescription
\Zend_Mobile_Push_Message_Exception
methodpublicsetTtl(int $secs) : \Zend_Mobile_Push_Message_Gcm

Set time to live If $secs is set to 0 it will be handled as not being set.

Parameters
NameTypeDescription
$secsint
Returns
TypeDescription
\Zend_Mobile_Push_Message_Gcm
methodpublictoJson() : string

To Json utility method Takes the data and properly assigns it to a json encoded array to match the Gcm format.

Returns
TypeDescription
string
methodpublicvalidate() : boolean

Validate this is a proper Gcm message Does not validate size.

Returns
TypeDescription
boolean
Documentation was generated by phpDocumentor 2.0.0a12.