mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-29 20:32:10 +02:00
#spotted by scripts/check-trans.php git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@258438 c90b9560-bf6c-de11-be94-00142212c4b1
181 lines
4.3 KiB
XML
181 lines
4.3 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.13 $ -->
|
|
<!-- EN-Revision: 1.8 Maintainer: yannick Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
|
|
<refentry xml:id="function.aggregate-info" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>aggregate_info</refname>
|
|
<refpurpose>Récupère les informations d'agrégation pour un objet donné</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>aggregate_info</methodname>
|
|
<methodparam><type>object</type><parameter>object</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Récupère les informations d'agrégation pour un objet donné.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>object</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Retourne un tableau associatif avec les méthodes et propriétés de chaque
|
|
classe qui a été agrégée pour former l'objet <parameter>object</parameter>.
|
|
La clé du tableau principal est le nom de la classe agrégée.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>aggregate_info</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
class Slicer {
|
|
var $vegetable;
|
|
|
|
function Slicer($vegetable)
|
|
{
|
|
$this->vegetable = $vegetable;
|
|
}
|
|
|
|
function slice_it($num_cuts)
|
|
{
|
|
echo "Doing some simple slicing\n";
|
|
for ($i=0; $i < $num_cuts; $i++) {
|
|
// coupe en tranches
|
|
}
|
|
}
|
|
}
|
|
|
|
class Dicer {
|
|
var $vegetable;
|
|
var $rotation_angle = 90; // degrés
|
|
|
|
function Dicer($vegetable)
|
|
{
|
|
$this->vegetable = $vegetable;
|
|
}
|
|
|
|
function dice_it($num_cuts)
|
|
{
|
|
echo "Couper dans une direction\n";
|
|
for ($i=0; $i < $num_cuts; $i++) {
|
|
// coupe
|
|
}
|
|
$this->rotate($this->rotation_angle);
|
|
echo "Couper dans une seconde direction\n";
|
|
for ($i=0; $i < $num_cuts; $i++) {
|
|
// coupe encore
|
|
}
|
|
}
|
|
|
|
function rotate($deg)
|
|
{
|
|
echo "Maintenant tourne {$this->vegetable} {$deg} degrés\n";
|
|
}
|
|
|
|
function _secret_super_dicing($num_cuts)
|
|
{
|
|
// tellement secret que nous ne pouvons vous montrer ;-)
|
|
}
|
|
}
|
|
|
|
$obj = new Slicer('onion');
|
|
aggregate($obj, 'Dicer');
|
|
print_r(aggregate_info($obj));
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
Array
|
|
(
|
|
[dicer] => Array
|
|
(
|
|
[methods] => Array
|
|
(
|
|
[0] => dice_it
|
|
[1] => rotate
|
|
)
|
|
|
|
[properties] => Array
|
|
(
|
|
[0] => rotation_angle
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
Comme vous pouvez le voir, toutes les méthodes et propriétés de la
|
|
classe <classname>Dicer</classname> ont été agrégées dans notre nouvel
|
|
objet, à l'exception de la classe constructeur et de la méthode
|
|
privée <methodname>_secret_super_dicing</methodname>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>aggregate</function></member>
|
|
<member><function>aggregate_methods</function></member>
|
|
<member><function>aggregate_methods_by_list</function></member>
|
|
<member><function>aggregate_methods_by_regexp</function></member>
|
|
<member><function>aggregate_properties</function></member>
|
|
<member><function>aggregate_properties_by_list</function></member>
|
|
<member><function>aggregate_properties_by_regexp</function></member>
|
|
<member><function>deaggregate</function></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:"../../../../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
|
|
-->
|