php-doc-en/reference/sam/functions/SAM-Connection-peekall.xml
Rudy Nappée 685a03b4b3 * No () in refnames
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@263467 c90b9560-bf6c-de11-be94-00142212c4b1
2008-07-24 21:54:47 +00:00

160 lines
3.9 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<refentry xml:id='function.samconnection-peekall' xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SAMConnection->peekAll</refname>
<refpurpose>
Read one or more messages from a queue without removing it from the queue.
</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<classsynopsis>
<ooclass><classname>SAMConnection</classname></ooclass>
<methodsynopsis>
<type>array</type><methodname>peekAll</methodname>
<methodparam><type>string</type><parameter>target</parameter></methodparam>
<methodparam choice='opt'><type>array</type><parameter>properties</parameter></methodparam>
</methodsynopsis>
</classsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>target</parameter></term>
<listitem>
<para>
The identity of the queue from which messages should be peeked.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>properties</parameter></term>
<listitem>
<para>
An optional associative array of properties describing other
parameters to control the peek operation.
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>Property name</entry>
<entry>Possible values</entry>
</row>
</thead>
<tbody>
<row>
<entry>SAM_CORRELID</entry>
<entry>
This is the target correlation id string of messages to be
peeked. This would typically have been returned by a "send"
request.
</entry>
</row>
<row>
<entry>SAM_MESSAGEID</entry>
<entry>
This is the message id string of a message which is to be peeked.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
This method returns an array of SAMMessage objects or &false; if an error
occurs.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Retrieve all messages in a queue without removing them</title>
<programlisting role="php">
<![CDATA[
<?php
$msgArray = $conn->peekAll('queue://receive/test');
if ($msgArray) {
foreach ( $msgArray as $key => $msg) {
echo "Message $key: body = $msg->body\n";
}
} else {
echo "PeekAll failed ($conn->errno) $conn->error";
}
?>
]]>
</programlisting>
</example>
</para>
<para>
<example>
<title>
Retrieve all messages from a queue with a matching correlation id
</title>
<programlisting role="php">
<![CDATA[
<?php
$msgArray = $conn->peekAll('queue://receive/test', array(SAM_CORRELID => $correlId ));
if ($msgArray) {
foreach ( $msgArray as $key => $msg) {
echo "Message $key: body = $msg->body\n";
}
}
else
echo "PeekAll failed ($conn->errno) $conn->error";
}
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><xref linkend="function.samconnection-peek" /></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->