<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="memcached.replacebykey" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 <refnamediv>
  <refname>Memcached::replaceByKey</refname>
  <refpurpose>Replace the item under an existing key on a specific server</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis role="Memcached">
   <modifier>public</modifier> <type>bool</type><methodname>Memcached::replaceByKey</methodname>
   <methodparam><type>string</type><parameter>server_key</parameter></methodparam>
   <methodparam><type>string</type><parameter>key</parameter></methodparam>
   <methodparam><type>mixed</type><parameter>value</parameter></methodparam>
   <methodparam choice="opt"><type>int</type><parameter>expiration</parameter><initializer>0</initializer></methodparam>
  </methodsynopsis>
  <para>
   <function>Memcached::replaceByKey</function> is functionally equivalent to
   <methodname>Memcached::replace</methodname>, except that the free-form
   <parameter>server_key</parameter> can be used to map the
   <parameter>key</parameter> to a specific server. This is useful if you need
   to keep a bunch of related keys on a certain server.
  </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>
       &memcached.parameter.key;
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>value</parameter></term>
     <listitem>
      <para>
       &memcached.parameter.value;
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>expiration</parameter></term>
     <listitem>
      <para>
       &memcached.parameter.expiration;
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   &return.success;
   The <methodname>Memcached::getResultCode</methodname> will return
   <constant>Memcached::RES_NOTSTORED</constant> if the key does not exist.
  </para>
 </refsect1>

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