php-doc-en/reference/sam/SAMConnection/peekAll.xml
Jakub Vrana 0d604bbc9d Remove <classsynopsis> from methods and fields definitions
PhD uses this context for decisions about links and similar.
It also simplifies the XML

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@322205 c90b9560-bf6c-de11-be94-00142212c4b1
2012-01-13 14:20:43 +00:00

156 lines
3.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id='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;
<methodsynopsis>
<type>array</type><methodname>SAMConnection::peekAll</methodname>
<methodparam><type>string</type><parameter>target</parameter></methodparam>
<methodparam choice="opt"><type>array</type><parameter>properties</parameter></methodparam>
</methodsynopsis>
</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="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:"~/.phpdoc/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
-->