Queue/Adapter/Db.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 [email protected] so we can send you a copy immediately.
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Queue  
Subpackage
Adapter  
Version
$Id$  

\Zend_Queue_Adapter_Db

Package: Zend_Queue\Adapter
Class for using connecting to a Zend_Db-based queuing system
Parent(s)
\Zend_Queue_Adapter_AdapterAbstract
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

>VPropertyprotected\Zend_Db_Table_Row_Abstract $_messageRow = null
Default valuenullDetails
Type
\Zend_Db_Table_Row_Abstract
>VPropertyprotected\Zend_Queue_Adapter_Db_Message $_messageTable = null
Default valuenullDetails
Type
\Zend_Queue_Adapter_Db_Message
>VPropertyprotected\Zend_Queue_Adapter_Db_Queue $_queueTable = null
Default valuenullDetails
Type
\Zend_Queue_Adapter_Db_Queue

Methods

methodpublic__construct(array | \Zend_Config $options, \Zend_Queue | null $queue = null) : void

Constructor

Parameters
NameTypeDescription
$optionsarray | \Zend_Config
$queue\Zend_Queue | null
methodprotected_initDbAdapter() : \Zend_Db_Adapter_Abstract

Initialize Db adapter using 'driverOptions' section of the _options array

Throws an exception if the adapter cannot connect to DB.
Returns
TypeDescription
\Zend_Db_Adapter_Abstract
Throws
ExceptionDescription
\Zend_Queue_Exception
methodpubliccount(\Zend_Queue $queue = null) : integer

Return the approximate number of messages in the queue

Parameters
NameTypeDescription
$queue\Zend_Queue
Returns
TypeDescription
integer
Throws
ExceptionDescription
\Zend_Queue_Exception
methodpubliccreate(string $name, integer $timeout = null) : boolean

Create a new queue

Visibility timeout is how long a message is left in the queue "invisible" to other readers. If the message is acknowleged (deleted) before the timeout, then the message is deleted. However, if the timeout expires then the message will be made available to other queue readers.
Parameters
NameTypeDescription
$namestring

queue name

$timeoutinteger

default visibility timeout

Returns
TypeDescription
boolean
Throws
ExceptionDescription
\Zend_Queue_Exception- database error
methodpublicdelete(string $name) : boolean

Delete a queue and all of it's messages

Returns false if the queue is not found, true if the queue exists
Parameters
NameTypeDescription
$namestring

queue name

Returns
TypeDescription
boolean
Throws
ExceptionDescription
\Zend_Queue_Exception- database error
methodpublicdeleteMessage(\Zend_Queue_Message $message) : boolean

Delete a message from the queue

Returns true if the message is deleted, false if the deletion is unsuccessful.
Parameters
NameTypeDescription
$message\Zend_Queue_Message
Returns
TypeDescription
boolean
Throws
ExceptionDescription
\Zend_Queue_Exception- database error
methodpublicgetCapabilities() : array

Return a list of queue capabilities functions

$array['function name'] = true or false true is supported, false is not supported.
Returns
TypeDescription
array
methodprotectedgetQueueId(string $name) : integer | null

Get the queue ID

Returns the queue's row identifier.
Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
integer | null
Throws
ExceptionDescription
\Zend_Queue_Exception
methodpublicgetQueues() : void

methodpublicisExists(string $name) : boolean

Does a queue already exist?

Throws an exception if the adapter cannot determine if a queue exists. use isSupported('isExists') to determine if an adapter can test for queue existance.
Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
boolean
Throws
ExceptionDescription
\Zend_Queue_Exception
methodpublicreceive(integer $maxMessages = null, integer $timeout = null, \Zend_Queue $queue = null) : \Zend_Queue_Message_Iterator

Get messages in the queue

Parameters
NameTypeDescription
$maxMessagesinteger

Maximum number of messages to return

$timeoutinteger

Visibility timeout for these messages

$queue\Zend_Queue
Returns
TypeDescription
\Zend_Queue_Message_Iterator
Throws
ExceptionDescription
\Zend_Queue_Exception- database error
methodpublicsend(string $message, \Zend_Queue $queue = null) : \Zend_Queue_Message

Send a message to the queue

Parameters
NameTypeDescription
$messagestring

Message to send to the active queue

$queue\Zend_Queue
Returns
TypeDescription
\Zend_Queue_Message
Throws
ExceptionDescription
\Zend_Queue_Exception- database error
Documentation was generated by phpDocumentor 2.2.0 .