<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="memcached.getbykey" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 <refnamediv>
  <refname>Memcached::getByKey</refname>
  <refpurpose>Retrieve an item from a specific server</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis role="Memcached">
   <modifier>public</modifier> <type>mixed</type><methodname>Memcached::getByKey</methodname>
   <methodparam><type>string</type><parameter>server_key</parameter></methodparam>
   <methodparam><type>string</type><parameter>key</parameter></methodparam>
   <methodparam choice="opt"><type class="union"><type>callable</type><type>null</type></type><parameter>cache_cb</parameter><initializer>&null;</initializer></methodparam>
   <methodparam choice="opt"><type>int</type><parameter>get_flags</parameter><initializer>0</initializer></methodparam>
  </methodsynopsis>
  <para>
   <function>Memcached::getByKey</function> is functionally equivalent to
   <methodname>Memcached::get</methodname>, except that the free-form
   <parameter>server_key</parameter> can be used to map the
   <parameter>key</parameter> to a specific 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>
       The key of the item to fetch.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>cache_cb</parameter></term>
     <listitem>
      <para>
       Read-through caching callback or &null;
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>get_flags</parameter></term>
     <listitem>
      <para>
       Flags to control the returned result. When value of <constant>Memcached::GET_EXTENDED</constant>
       is given will return the CAS token.
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   Returns the value stored in the cache or &false; otherwise.
   The <methodname>Memcached::getResultCode</methodname> will return
   <constant>Memcached::RES_NOTFOUND</constant> if the key does not exist.
  </para>
 </refsect1>

 <refsect1 role="changelog">
  &reftitle.changelog;
  <informaltable>
   <tgroup cols="2">
    <thead>
     <row>
      <entry>&Version;</entry>
      <entry>&Description;</entry>
     </row>
    </thead>
    <tbody>
     <row>
      <entry>PECL memcached 3.0.0</entry>
      <entry>
       The <parameter role="reference">cas_token</parameter> parameter was removed.
       Instead <parameter>get_flags</parameter> was added and when it is given the value of <constant>Memcached::GET_EXTENDED</constant> it will ensure the CAS token to be fetched.
      </entry>
     </row>
    </tbody>
   </tgroup>
  </informaltable>
 </refsect1>

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