mirror of
https://github.com/php/doc-es.git
synced 2026-03-26 00:12:06 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@326627 c90b9560-bf6c-de11-be94-00142212c4b1
122 lines
3.2 KiB
XML
122 lines
3.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 60ec2446182c3f45d16a13c0be0b18baf5a13a48 Maintainer: seros Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
|
|
<refentry xml:id="quickhashstringinthash.update" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>QuickHashStringIntHash::update</refname>
|
|
<refpurpose>Este método actualiza una entrada de un hash con un nuevo valor</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<modifier>public</modifier> <type>bool</type><methodname>QuickHashStringIntHash::update</methodname>
|
|
<methodparam><type>string</type><parameter>key</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>value</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Este método actualiza una entrada un nuevo valor, y devuelve si la entrada fue
|
|
actualizada o no. Si existen claves duplicadas, solamente se actualizará el valor del
|
|
primero elemento encontrado. Use QuickHashStringIntHash::CHECK_FOR_DUPES durante la
|
|
creación del hash para evitar que las claves duplicadas sean parte de un hash.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>key</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
La clave de la entrada a añadir.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>value</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
El nuevo valor de la entrada. Si se pasa algo que no sea un string, será
|
|
convertidoa un string automáticamente, si fuera posible.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&true; si la entrada se encontró y se actualizó, y &false; si la entrada
|
|
no formaba parte del hash.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Ejemplo de <function>QuickHashStringIntHash::update</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$hash = new QuickHashStringIntHash( 1024 );
|
|
|
|
$hash->add( 'six', 314159265 );
|
|
$hash->add( "a lot", 314159265 );
|
|
|
|
echo $hash->get( 'six' ), "\n";
|
|
echo $hash->get( 'a lot' ), "\n";
|
|
|
|
var_dump( $hash->update( 'a lot', 314159266 ) );
|
|
var_dump( $hash->update( "a lot plus one", 314159999 ) );
|
|
|
|
echo $hash->get( 'six' ), "\n";
|
|
echo $hash->get( 'a lot' ), "\n";
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
314159265
|
|
314159265
|
|
bool(true)
|
|
bool(false)
|
|
314159265
|
|
314159266
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</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
|
|
-->
|