<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Remove a message from a queue.</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="samconnection.receive.html">SAMConnection::receive</a></div> <div class="next" style="text-align: right; float: right;"><a href="samconnection.rollback.html">SAMConnection::rollback</a></div> <div class="up"><a href="ref.sam.html">SAM Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="samconnection.remove" class="refentry"> <div class="refnamediv"> <h1 class="refname">SAMConnection::remove</h1> <p class="verinfo">(PECL sam >= 0.1.0)</p><p class="refpurpose"><span class="refname">SAMConnection::remove</span> — <span class="dc-title"> Remove a message from a queue. </span></p> </div> <div class="refsect1 description" id="refsect1-samconnection.remove-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type"><a href="ref.sam.html" class="type SAMMessage">SAMMessage</a></span> <span class="methodname"><strong>SAMConnection::remove</strong></span> ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$target</code></span> [, <span class="methodparam"><span class="type">array</span> <code class="parameter">$properties</code></span> ] )</div> <p class="para rdfs-comment"> Removes a message from a queue. </p> </div> <div class="refsect1 parameters" id="refsect1-samconnection.remove-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter">target</code></em></span> <dd> <p class="para"> The identity of the queue from which to remove the message. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">properties</code></em></span> <dd> <p class="para"> An optional associative array of properties describing other parameters to control the remove operation. <table class="doctable informaltable"> <thead> <tr> <th>Property name</th> <th>Possible values</th> </tr> </thead> <tbody class="tbody"> <tr> <td>SAM_CORRELID</td> <td> This is the target correlation id string of the message. This would typically have been returned by a "send" request. </td> </tr> <tr> <td>SAM_MESSAGEID</td> <td> This is the message id string of the message which is to be removed. </td> </tr> </tbody> </table> </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-samconnection.remove-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> This method returns <strong><code>FALSE</code></strong> if an error occurs. </p> </div> <div class="refsect1 examples" id="refsect1-samconnection.remove-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-4531"> <p><strong>Example #1 Removing a message from a queue by message id</strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br /></span><span style="color: #007700">if (!</span><span style="color: #0000BB">$conn</span><span style="color: #007700">-></span><span style="color: #0000BB">remove</span><span style="color: #007700">(</span><span style="color: #DD0000">'queue://receive/test'</span><span style="color: #007700">, array(</span><span style="color: #0000BB">SAM_MESSAGEID </span><span style="color: #007700">=> </span><span style="color: #0000BB">$messageId</span><span style="color: #007700">))) {<br /> </span><span style="color: #FF8000">// The remove failed!<br /> </span><span style="color: #007700">echo </span><span style="color: #DD0000">"Remove failed (</span><span style="color: #0000BB">$conn</span><span style="color: #007700">-></span><span style="color: #0000BB">errno</span><span style="color: #DD0000">) </span><span style="color: #0000BB">$conn</span><span style="color: #007700">-></span><span style="color: #0000BB">error</span><span style="color: #DD0000">"</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> </div> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="samconnection.receive.html">SAMConnection::receive</a></div> <div class="next" style="text-align: right; float: right;"><a href="samconnection.rollback.html">SAMConnection::rollback</a></div> <div class="up"><a href="ref.sam.html">SAM Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>