<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="memcached.decrementbykey" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 <refnamediv>
  <refname>Memcached::decrementByKey</refname>
  <refpurpose>Decrement numeric item's value, stored on a specific server</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis role="Memcached">
   <modifier>public</modifier> <type class="union"><type>int</type><type>false</type></type><methodname>Memcached::decrementByKey</methodname>
   <methodparam><type>string</type><parameter>server_key</parameter></methodparam>
   <methodparam><type>string</type><parameter>key</parameter></methodparam>
   <methodparam choice="opt"><type>int</type><parameter>offset</parameter><initializer>1</initializer></methodparam>
   <methodparam choice="opt"><type>int</type><parameter>initial_value</parameter><initializer>0</initializer></methodparam>
   <methodparam choice="opt"><type>int</type><parameter>expiry</parameter><initializer>0</initializer></methodparam>
  </methodsynopsis>
  <para>
   <function>Memcached::decrementByKey</function> decrements a numeric item's
   value by the specified <parameter>offset</parameter>. If the item's value
   is not numeric, an error will result. If the operation
   would decrease the value below 0, the new value will be 0.
   <function>Memcached::decrementByKey</function> will set the item to the
   <parameter>initial_value</parameter> parameter if the key doesn't exist.
  </para>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    <varlistentry>
     <term><parameter>server_key</parameter></term>
     <listitem>
      <para>
       &memcached.parameter.server_key;
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>key</parameter></term>
     <listitem>
      <para>
       The key of the item to decrement.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>offset</parameter></term>
     <listitem>
      <para>
       The amount by which to decrement the item's value.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>initial_value</parameter></term>
     <listitem>
      <para>
       The value to set the item to if it doesn't currently exist.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>expiry</parameter></term>
     <listitem>
      <para>
       The expiry time to set on the item.
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   Returns item's new value on success&return.falseforfailure;.
  </para>
 </refsect1>

 <refsect1 role="seealso">
  &reftitle.seealso;
  <para>
   <simplelist>
    <member><methodname>Memcached::decrement</methodname></member>
    <member><methodname>Memcached::increment</methodname></member>
    <member><methodname>Memcached::incrementByKey</methodname></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
-->
