mirror of
https://github.com/php/doc-es.git
synced 2026-04-25 16:18:09 +02:00
112 lines
3.1 KiB
XML
112 lines
3.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: bfe06c36ec1c0a37909704b292a204195b0bc14f Maintainer: PhilDaiguille Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="quickhashintstringhash.update">
|
|
<refnamediv>
|
|
<refname>QuickHashIntStringHash::update</refname>
|
|
<refpurpose>Este método actualiza una entrada en el hash con un nuevo valor</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<modifier>public</modifier> <type>bool</type><methodname>QuickHashIntStringHash::update</methodname>
|
|
<methodparam><type>int</type><parameter>key</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>value</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<simpara>
|
|
Este método actualiza una entrada con un nuevo valor y devuelve si
|
|
la entrada ha sido actualizada. Si hay claves duplicadas, solo el
|
|
primer elemento encontrado será actualizado. Utilice QuickHashIntStringHash::CHECK_FOR_DUPES
|
|
al crear el hash para evitar que las claves duplicadas formen parte del hash.
|
|
</simpara>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>key</parameter></term>
|
|
<listitem>
|
|
<simpara>
|
|
La clave de la entrada a actualizar.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>value</parameter></term>
|
|
<listitem>
|
|
<simpara>
|
|
El nuevo valor para la entrada. Si se pasa un valor que no es una string, se
|
|
convertirá automáticamente en una string si es posible.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<simpara>
|
|
&true; cuando la entrada ha sido encontrada y actualizada, y &false; si la entrada no
|
|
era ya parte del hash.
|
|
</simpara>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<example>
|
|
<title>Ejemplo de <function>QuickHashIntStringHash::update</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$hash->add( 161803398, "--" );
|
|
$hash->add( 314159265, "a lot" );
|
|
|
|
echo $hash->get( 161803398 ), "\n";
|
|
echo $hash->get( 314159265 ), "\n";
|
|
|
|
var_dump( $hash->update( 314159265, "a lot plus one" ) );
|
|
var_dump( $hash->update( 314159999, "a lot plus one" ) );
|
|
|
|
echo $hash->get( 161803398 ), "\n";
|
|
echo $hash->get( 314159265 ), "\n";
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
--
|
|
a lot
|
|
bool(true)
|
|
bool(false)
|
|
--
|
|
a lot plus one
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</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
|
|
-->
|