cvs: phpdoc-fr /reference/objaggregation reference.xml /reference/objaggregation/functions aggregate-info.xml aggregate-methods-by-list.xml
aggregate-methods-by-regexp.xml aggregate-properties-by-list.xml aggregate-properties-by-regexp.xml aggregation-info.xml deaggregate.xml
| From: | Damien Seguy | Date: | Fri, 11 Jul 2003 02:37:58 +0000 |
| Subject: | cvs: phpdoc-fr /reference/objaggregation reference.xml /reference/objaggregation/functions aggregate-info.xml aggregate-methods-by-list.xml aggregate-methods-by-regexp.xml aggregate-properties-by-list.xml aggregate-properties-by-regexp.xml aggregation-info.xml deaggregate.xml |
||
| Groups: | php.doc.fr | ||
| Request: | Send a blank email to doc-fr+get-620@lists.php.net to get a copy of this message | ||
dams Thu Jul 10 22:37:58 2003 EDT
Added files:
/phpdoc-fr/reference/objaggregation/functions aggregate-info.xml
aggregate-properties-by-list.xml
aggregate-properties-by-regexp.xml
Modified files:
/phpdoc-fr/reference/objaggregation reference.xml
/phpdoc-fr/reference/objaggregation/functions
aggregate-methods-by-list.xml
aggregate-methods-by-regexp.xml
aggregation-info.xml
deaggregate.xml
Log:
keep up with en tree
Index: phpdoc-fr/reference/objaggregation/reference.xml diff -u phpdoc-fr/reference/objaggregation/reference.xml:1.2 phpdoc-fr/reference/objaggregation/reference.xml:1.3 --- phpdoc-fr/reference/objaggregation/reference.xml:1.2 Thu Jul 3 06:03:30 2003 +++ phpdoc-fr/reference/objaggregation/reference.xml Thu Jul 10 22:37:57 2003 @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <reference id="ref.objaggregation"> <title>Aggregation d'objets/Composition de fonctions</title> <titleabbrev>Aggregation d'objets</titleabbrev> - <partintro id="objaggregation.partintro"> + <partintro> &warn.experimental; <section id="objaggregation.intro"> &reftitle.intro; Index: phpdoc-fr/reference/objaggregation/functions/aggregate-methods-by-list.xml diff -u phpdoc-fr/reference/objaggregation/functions/aggregate-methods-by-list.xml:1.1 phpdoc-fr/reference/objaggregation/functions/aggregate-methods-by-list.xml:1.2 --- phpdoc-fr/reference/objaggregation/functions/aggregate-methods-by-list.xml:1.1 Fri Oct 25 15:10:31 2002 +++ phpdoc-fr/reference/objaggregation/functions/aggregate-methods-by-list.xml Thu Jul 10 22:37:58 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.aggregate-methods-by-list"> <refnamediv> <refname>aggregate_methods_by_list</refname> @@ -14,7 +14,7 @@ <methodparam><type>object</type><parameter>object</parameter></methodparam> <methodparam><type>string</type><parameter>class_name</parameter></methodparam> <methodparam><type>array</type><parameter>methods_list</parameter></methodparam> - <methodparam choice='opt'><type>boolean</type><parameter>exclude</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>exclude</parameter></methodparam> </methodsynopsis> <para> <function>aggregate_methods_by_list</function> aggrège les méthodes Index: phpdoc-fr/reference/objaggregation/functions/aggregate-methods-by-regexp.xml diff -u phpdoc-fr/reference/objaggregation/functions/aggregate-methods-by-regexp.xml:1.1 phpdoc-fr/reference/objaggregation/functions/aggregate-methods-by-regexp.xml:1.2 --- phpdoc-fr/reference/objaggregation/functions/aggregate-methods-by-regexp.xml:1.1 Fri Oct 25 15:10:31 2002 +++ phpdoc-fr/reference/objaggregation/functions/aggregate-methods-by-regexp.xml Thu Jul 10 22:37:58 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.aggregate-methods-by-regexp"> <refnamediv> <refname>aggregate_methods_by_regexp</refname> @@ -14,7 +14,7 @@ <methodparam><type>object</type><parameter>object</parameter></methodparam> <methodparam><type>string</type><parameter>class_name</parameter></methodparam> <methodparam><type>string</type><parameter>regexp</parameter></methodparam> - <methodparam choice='opt'><type>boolean</type><parameter>exclude</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>exclude</parameter></methodparam> </methodsynopsis> <para> <function>aggregate_methods_by_regexp</function> aggrège les méthodes Index: phpdoc-fr/reference/objaggregation/functions/aggregation-info.xml diff -u phpdoc-fr/reference/objaggregation/functions/aggregation-info.xml:1.1 phpdoc-fr/reference/objaggregation/functions/aggregation-info.xml:1.2 --- phpdoc-fr/reference/objaggregation/functions/aggregation-info.xml:1.1 Fri Oct 25 15:10:31 2002 +++ phpdoc-fr/reference/objaggregation/functions/aggregation-info.xml Thu Jul 10 22:37:58 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.aggregation-info"> <refnamediv> <refname>aggregation_info</refname> @@ -16,111 +16,7 @@ <para> <function>aggregation_info</function> retourne les informations d'aggrégation pour l'objet <parameter>object</parameter>, sous la forme d'un tableau associatif. - Les clés de ce tableau sont les noms des classes aggrégées. </para> - <para> - Par exemple, le code ci-dessous - <example> - <title>Exemple avec <function>aggregation_info</function></title> - <programlisting role='php'> -<![CDATA[ -<?php - -class Slicer { - var $vegetable; - - function Slicer($vegetable) { - $this->vegetable = $vegetable; - } - - function slice_it($num_cuts) { - echo "Tranchage\n"; - for ($i=0; $i < $num_cuts; $i++) { - // un peu de tranchage some slicing - } - } -} - -class Dicer { - var $vegetable; - var $rotation_angle = 90; // degrés - - function Dicer($vegetable) { - $this->vegetable = $vegetable; - } - - function dice_it($num_cuts) { - echo "Coupe suivant une direction\n"; - for ($i=0; $i < $num_cuts; $i++) { - // tranchage - } - $this->rotate($this->rotation_angle); - echo "Coupe suivant une autre direction\n"; - for ($i=0; $i < $num_cuts; $i++) { - // tranchage encoer - } - } - - function rotate($deg) { - echo "Rotation de {$this->vegetable} {$deg} degrés\n"; - } - - function _secret_super_dicing($num_cuts) { - // secret industriel, a ne pas montrer. - } -} - -$obj = new Slicer('onion'); -aggregate($obj, 'Dicer'); -print_r(aggregate_info($obj)); -?> -]]> - </programlisting> - </example> - </para> - <para> - va produire le résultat suivant - <informalexample> - <programlisting> -<![CDATA[ -Array -( - [dicer] => Array - ( - [methods] => Array - ( - [0] => dice_it - [1] => rotate - ) - - [properties] => Array - ( - [0] => rotation_angle - ) - - ) - -) -]]> - </programlisting> - </informalexample> - Comme vous pouvez le voir, toutes les méthodes et propriétés de - <classname>Dicer</classname> ont été aggrégées dans notre nouvel - objet, a l'excéption de la classe constructuer, et de la méthode - <methodname>_secret_super_dicing</methodname> - </para> - <simpara> - Voir aussi - <function>aggregate</function>, - <function>aggregate_methods</function>, - <function>aggregate_methods_by_list</function>, - <function>aggregate_methods_by_regexp</function>, - <function>aggregate_properties</function>, - <function>aggregate_properties_by_list</function>, - <function>aggregate_properties_by_regexp</function> et - <function>deaggregate</function> - - </simpara> </refsect1> </refentry> Index: phpdoc-fr/reference/objaggregation/functions/deaggregate.xml diff -u phpdoc-fr/reference/objaggregation/functions/deaggregate.xml:1.1 phpdoc-fr/reference/objaggregation/functions/deaggregate.xml:1.2 --- phpdoc-fr/reference/objaggregation/functions/deaggregate.xml:1.1 Fri Oct 25 15:10:31 2002 +++ phpdoc-fr/reference/objaggregation/functions/deaggregate.xml Thu Jul 10 22:37:58 2003 @@ -1,26 +1,27 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.deaggregate"> <refnamediv> <refname>deaggregate</refname> - <refpurpose> - Desaggrège un objet - </refpurpose> + <refpurpose>Desaggrège un objet</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> - <type>void</type><methodname>object_aggregation</methodname> + <type>void</type><methodname>deaggregate</methodname> <methodparam><type>object</type><parameter>object</parameter></methodparam> - <methodparam choice='opt'><type>string</type><parameter>class_name</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>class_name</parameter></methodparam> </methodsynopsis> <para> - <function>object_aggregation</function> supprime les méthodes et propriétés de la classe - <parameter>class_name</parameter>, qui ont été aggrégées dans l'objet + <function>deaggregate</function> supprime les méthodes et + propriétés de la classe + <parameter>class_name</parameter>, qui ont été + aggrégées dans l'objet <parameter>object</parameter>. Si le paramètre optionnel - <parameter>class_name</parameter> est passé, seules les méthodes - et propriétés de cette classe sont désaggrégées. Sinon, toutes les - méthodes et propriétés aggrégées sont retirées. + <parameter>class_name</parameter> est passé, seules les + méthodes et propriétés de cette classe sont + désaggrégées. Sinon, toutes les méthodes + et propriétés aggrégées sont retirées. </para> <simpara> Voir aussi Index: phpdoc-fr/reference/objaggregation/functions/aggregate-info.xml +++ phpdoc-fr/reference/objaggregation/functions/aggregate-info.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.aggregate-info"> <refnamediv> <refname>aggregate_info</refname> <refpurpose> Retourne un tableau associatif avec les méthodes et propriétés de chaque classe qui a été aggrégée </refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>array</type><methodname>aggregate_info</methodname> <methodparam><type>object</type><parameter>object</parameter></methodparam> </methodsynopsis> <para> <function>aggregate_info</function> retourne un tableau associatif avec les méthodes et propriétés de chaque classe qui a été aggrégée pour former l'objet <parameter>object</parameter>. La clé du tableau principal est le nom de la classe aggrégée. </para> <para> Pour un exemple, voir le code ci-dessous. <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++) { // do some slicing } } } class Dicer { var $vegetable; var $rotation_angle = 90; // degrees function Dicer($vegetable) { $this->vegetable = $vegetable; } function dice_it($num_cuts) { echo "Cutting in one direction\n"; for ($i=0; $i < $num_cuts; $i++) { // do some cutting } $this->rotate($this->rotation_angle); echo "Cutting in a second direction\n"; for ($i=0; $i < $num_cuts; $i++) { // do some more cutting } } function rotate($deg) { echo "Now rotating {$this->vegetable} {$deg} degrees\n"; } function _secret_super_dicing($num_cuts) { // so secret we cannot show you ;-) } } $obj = new Slicer('onion'); aggregate($obj, 'Dicer'); print_r(aggregate_info($obj)); ?> ]]> </programlisting> </example> </para> <para> Va produire l'affichage : <informalexample> <programlisting> <![CDATA[ Array ( [dicer] => Array ( [methods] => Array ( [0] => dice_it [1] => rotate ) [properties] => Array ( [0] => rotation_angle ) ) ) ]]> </programlisting> </informalexample> Comme vous pouvez le voir, toutes les méthodes et propriétés de la classe <classname>dicer</classname> ont été aggrégée dans notre nouvel objet, à l'exception de la classe constructeur et de la méthode privée <methodname>_secret_super_dicing</methodname> </para> <simpara> Voir aussi <function>aggregate</function>, <function>aggregate_methods</function>, <function>aggregate_methods_by_list</function>, <function>aggregate_methods_by_regexp</function>, <function>aggregate_properties</function>, <function>aggregate_properties_by_list</function>, <function>aggregate_properties_by_regexp</function> et <function>deaggregate</function> </simpara> </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 --> Index: phpdoc-fr/reference/objaggregation/functions/aggregate-properties-by-list.xml +++ phpdoc-fr/reference/objaggregation/functions/aggregate-properties-by-list.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.aggregate-properties-by-list"> <refnamediv> <refname>aggregate_properties_by_list</refname> <refpurpose> Aggrège sélectivement les propriétés d'une classe grâce à une liste </refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>void</type><methodname>aggregate_properties_by_list</methodname> <methodparam><type>object</type><parameter>object</parameter></methodparam> <methodparam><type>string</type><parameter>class_name</parameter></methodparam> <methodparam><type>array</type><parameter>properties_list</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>exclude</parameter></methodparam> </methodsynopsis> <para> <function>aggregate_properties_by_list</function> aggrège les propriétés de la classe <parameter>class_name</parameter> avec l'objet <parameter>object</parameter>, en filtrant les propriétés aggrégées grâce à la liste <parameter>methods_list</parameter>, appliquée au nom de la propriété. Le paramètre optionnel <parameter>exclude</parameter> sert à décider si l'expression régulière sélectionne les propriétés ( <parameter>exclude</parameter> vaut &false; sa valeur par défaut), ou bien si elle sert à identifier les propriétés qui doivent être exclues (<parameter>exclude</parameter> vaut &true;). </para> <para> Les propriétés dont le nom commence par un caractère souligné ("_"), qui sont considérées comme privées, sont toujours exclues. </para> <simpara> Voir aussi <function>aggregate</function>, <function>aggregate_methods</function>, <function>aggregate_methods_by_list</function>, <function>aggregate_methods_by_regexp</function>, <function>aggregate_properties</function>, <function>aggregate_properties_by_regexp</function>, <function>aggregate_info</function>, <function>deaggregate</function> </simpara> </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 --> Index: phpdoc-fr/reference/objaggregation/functions/aggregate-properties-by-regexp.xml +++ phpdoc-fr/reference/objaggregation/functions/aggregate-properties-by-regexp.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.aggregate-properties-by-regexp"> <refnamediv> <refname>aggregate_properties_by_regexp</refname> <refpurpose> Aggrège sélectivement les propriétés d'une classe grâce à une expression régulière </refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>void</type><methodname>aggregate_properties_by_regexp</methodname> <methodparam><type>object</type><parameter>object</parameter></methodparam> <methodparam><type>string</type><parameter>class_name</parameter></methodparam> <methodparam><type>string</type><parameter>regexp</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>exclude</parameter></methodparam> </methodsynopsis> <para> <function>aggregate_properties_by_regexp</function> aggrège les propriétés de la classe <parameter>class_name</parameter> avec l'objet <parameter>object</parameter>, en filtrant les propriétés aggrégées grâce à l'expression régulière <parameter>regexp</parameter>, appliquée au nom de la propriétés. Le paramètre optionnel <parameter>exclude</parameter> sert à décider si l'expression régulière sélectionne les propriétés (<parameter>exclude</parameter> vaut &false; sa valeur par défaut), ou bien si elle sert à identifier les propriétés qui doivent être exclues (<parameter>exclude</parameter> vaut &true;). </para> <para> Les propriétés dont le nom commence par un caractère souligné ("_"), qui sont considérées comme privées, sont toujours exclues. </para> <simpara> Voir aussi <function>aggregate</function>, <function>aggregate_methods</function>, <function>aggregate_methods_by_list</function>, <function>aggregate_methods_by_regexp</function>, <function>aggregate_properties</function>, <function>aggregate_properties_by_list</function>, <function>aggregate_info</function> et <function>deaggregate</function> </simpara> </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 -->
Index: phpdoc-fr/reference/objaggregation/reference.xml diff -u phpdoc-fr/reference/objaggregation/reference.xml:1.2 phpdoc-fr/reference/objaggregation/reference.xml:1.3 --- phpdoc-fr/reference/objaggregation/reference.xml:1.2 Thu Jul 3 06:03:30 2003 +++ phpdoc-fr/reference/objaggregation/reference.xml Thu Jul 10 22:37:57 2003 @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <reference id="ref.objaggregation"> <title>Aggregation d'objets/Composition de fonctions</title> <titleabbrev>Aggregation d'objets</titleabbrev> - <partintro id="objaggregation.partintro"> + <partintro> &warn.experimental; <section id="objaggregation.intro"> &reftitle.intro; Index: phpdoc-fr/reference/objaggregation/functions/aggregate-methods-by-list.xml diff -u phpdoc-fr/reference/objaggregation/functions/aggregate-methods-by-list.xml:1.1 phpdoc-fr/reference/objaggregation/functions/aggregate-methods-by-list.xml:1.2 --- phpdoc-fr/reference/objaggregation/functions/aggregate-methods-by-list.xml:1.1 Fri Oct 25 15:10:31 2002 +++ phpdoc-fr/reference/objaggregation/functions/aggregate-methods-by-list.xml Thu Jul 10 22:37:58 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.aggregate-methods-by-list"> <refnamediv> <refname>aggregate_methods_by_list</refname> @@ -14,7 +14,7 @@ <methodparam><type>object</type><parameter>object</parameter></methodparam> <methodparam><type>string</type><parameter>class_name</parameter></methodparam> <methodparam><type>array</type><parameter>methods_list</parameter></methodparam> - <methodparam choice='opt'><type>boolean</type><parameter>exclude</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>exclude</parameter></methodparam> </methodsynopsis> <para> <function>aggregate_methods_by_list</function> aggrège les méthodes Index: phpdoc-fr/reference/objaggregation/functions/aggregate-methods-by-regexp.xml diff -u phpdoc-fr/reference/objaggregation/functions/aggregate-methods-by-regexp.xml:1.1 phpdoc-fr/reference/objaggregation/functions/aggregate-methods-by-regexp.xml:1.2 --- phpdoc-fr/reference/objaggregation/functions/aggregate-methods-by-regexp.xml:1.1 Fri Oct 25 15:10:31 2002 +++ phpdoc-fr/reference/objaggregation/functions/aggregate-methods-by-regexp.xml Thu Jul 10 22:37:58 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.aggregate-methods-by-regexp"> <refnamediv> <refname>aggregate_methods_by_regexp</refname> @@ -14,7 +14,7 @@ <methodparam><type>object</type><parameter>object</parameter></methodparam> <methodparam><type>string</type><parameter>class_name</parameter></methodparam> <methodparam><type>string</type><parameter>regexp</parameter></methodparam> - <methodparam choice='opt'><type>boolean</type><parameter>exclude</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>exclude</parameter></methodparam> </methodsynopsis> <para> <function>aggregate_methods_by_regexp</function> aggrège les méthodes Index: phpdoc-fr/reference/objaggregation/functions/aggregation-info.xml diff -u phpdoc-fr/reference/objaggregation/functions/aggregation-info.xml:1.1 phpdoc-fr/reference/objaggregation/functions/aggregation-info.xml:1.2 --- phpdoc-fr/reference/objaggregation/functions/aggregation-info.xml:1.1 Fri Oct 25 15:10:31 2002 +++ phpdoc-fr/reference/objaggregation/functions/aggregation-info.xml Thu Jul 10 22:37:58 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.aggregation-info"> <refnamediv> <refname>aggregation_info</refname> @@ -16,111 +16,7 @@ <para> <function>aggregation_info</function> retourne les informations d'aggrégation pour l'objet <parameter>object</parameter>, sous la forme d'un tableau associatif. - Les clés de ce tableau sont les noms des classes aggrégées. </para> - <para> - Par exemple, le code ci-dessous - <example> - <title>Exemple avec <function>aggregation_info</function></title> - <programlisting role='php'> -<![CDATA[ -<?php - -class Slicer { - var $vegetable; - - function Slicer($vegetable) { - $this->vegetable = $vegetable; - } - - function slice_it($num_cuts) { - echo "Tranchage\n"; - for ($i=0; $i < $num_cuts; $i++) { - // un peu de tranchage some slicing - } - } -} - -class Dicer { - var $vegetable; - var $rotation_angle = 90; // degrés - - function Dicer($vegetable) { - $this->vegetable = $vegetable; - } - - function dice_it($num_cuts) { - echo "Coupe suivant une direction\n"; - for ($i=0; $i < $num_cuts; $i++) { - // tranchage - } - $this->rotate($this->rotation_angle); - echo "Coupe suivant une autre direction\n"; - for ($i=0; $i < $num_cuts; $i++) { - // tranchage encoer - } - } - - function rotate($deg) { - echo "Rotation de {$this->vegetable} {$deg} degrés\n"; - } - - function _secret_super_dicing($num_cuts) { - // secret industriel, a ne pas montrer. - } -} - -$obj = new Slicer('onion'); -aggregate($obj, 'Dicer'); -print_r(aggregate_info($obj)); -?> -]]> - </programlisting> - </example> - </para> - <para> - va produire le résultat suivant - <informalexample> - <programlisting> -<![CDATA[ -Array -( - [dicer] => Array - ( - [methods] => Array - ( - [0] => dice_it - [1] => rotate - ) - - [properties] => Array - ( - [0] => rotation_angle - ) - - ) - -) -]]> - </programlisting> - </informalexample> - Comme vous pouvez le voir, toutes les méthodes et propriétés de - <classname>Dicer</classname> ont été aggrégées dans notre nouvel - objet, a l'excéption de la classe constructuer, et de la méthode - <methodname>_secret_super_dicing</methodname> - </para> - <simpara> - Voir aussi - <function>aggregate</function>, - <function>aggregate_methods</function>, - <function>aggregate_methods_by_list</function>, - <function>aggregate_methods_by_regexp</function>, - <function>aggregate_properties</function>, - <function>aggregate_properties_by_list</function>, - <function>aggregate_properties_by_regexp</function> et - <function>deaggregate</function> - - </simpara> </refsect1> </refentry> Index: phpdoc-fr/reference/objaggregation/functions/deaggregate.xml diff -u phpdoc-fr/reference/objaggregation/functions/deaggregate.xml:1.1 phpdoc-fr/reference/objaggregation/functions/deaggregate.xml:1.2 --- phpdoc-fr/reference/objaggregation/functions/deaggregate.xml:1.1 Fri Oct 25 15:10:31 2002 +++ phpdoc-fr/reference/objaggregation/functions/deaggregate.xml Thu Jul 10 22:37:58 2003 @@ -1,26 +1,27 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.deaggregate"> <refnamediv> <refname>deaggregate</refname> - <refpurpose> - Desaggrège un objet - </refpurpose> + <refpurpose>Desaggrège un objet</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> - <type>void</type><methodname>object_aggregation</methodname> + <type>void</type><methodname>deaggregate</methodname> <methodparam><type>object</type><parameter>object</parameter></methodparam> - <methodparam choice='opt'><type>string</type><parameter>class_name</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>class_name</parameter></methodparam> </methodsynopsis> <para> - <function>object_aggregation</function> supprime les méthodes et propriétés de la classe - <parameter>class_name</parameter>, qui ont été aggrégées dans l'objet + <function>deaggregate</function> supprime les méthodes et + propriétés de la classe + <parameter>class_name</parameter>, qui ont été + aggrégées dans l'objet <parameter>object</parameter>. Si le paramètre optionnel - <parameter>class_name</parameter> est passé, seules les méthodes - et propriétés de cette classe sont désaggrégées. Sinon, toutes les - méthodes et propriétés aggrégées sont retirées. + <parameter>class_name</parameter> est passé, seules les + méthodes et propriétés de cette classe sont + désaggrégées. Sinon, toutes les méthodes + et propriétés aggrégées sont retirées. </para> <simpara> Voir aussi Index: phpdoc-fr/reference/objaggregation/functions/aggregate-info.xml +++ phpdoc-fr/reference/objaggregation/functions/aggregate-info.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.aggregate-info"> <refnamediv> <refname>aggregate_info</refname> <refpurpose> Retourne un tableau associatif avec les méthodes et propriétés de chaque classe qui a été aggrégée </refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>array</type><methodname>aggregate_info</methodname> <methodparam><type>object</type><parameter>object</parameter></methodparam> </methodsynopsis> <para> <function>aggregate_info</function> retourne un tableau associatif avec les méthodes et propriétés de chaque classe qui a été aggrégée pour former l'objet <parameter>object</parameter>. La clé du tableau principal est le nom de la classe aggrégée. </para> <para> Pour un exemple, voir le code ci-dessous. <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++) { // do some slicing } } } class Dicer { var $vegetable; var $rotation_angle = 90; // degrees function Dicer($vegetable) { $this->vegetable = $vegetable; } function dice_it($num_cuts) { echo "Cutting in one direction\n"; for ($i=0; $i < $num_cuts; $i++) { // do some cutting } $this->rotate($this->rotation_angle); echo "Cutting in a second direction\n"; for ($i=0; $i < $num_cuts; $i++) { // do some more cutting } } function rotate($deg) { echo "Now rotating {$this->vegetable} {$deg} degrees\n"; } function _secret_super_dicing($num_cuts) { // so secret we cannot show you ;-) } } $obj = new Slicer('onion'); aggregate($obj, 'Dicer'); print_r(aggregate_info($obj)); ?> ]]> </programlisting> </example> </para> <para> Va produire l'affichage : <informalexample> <programlisting> <![CDATA[ Array ( [dicer] => Array ( [methods] => Array ( [0] => dice_it [1] => rotate ) [properties] => Array ( [0] => rotation_angle ) ) ) ]]> </programlisting> </informalexample> Comme vous pouvez le voir, toutes les méthodes et propriétés de la classe <classname>dicer</classname> ont été aggrégée dans notre nouvel objet, à l'exception de la classe constructeur et de la méthode privée <methodname>_secret_super_dicing</methodname> </para> <simpara> Voir aussi <function>aggregate</function>, <function>aggregate_methods</function>, <function>aggregate_methods_by_list</function>, <function>aggregate_methods_by_regexp</function>, <function>aggregate_properties</function>, <function>aggregate_properties_by_list</function>, <function>aggregate_properties_by_regexp</function> et <function>deaggregate</function> </simpara> </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 --> Index: phpdoc-fr/reference/objaggregation/functions/aggregate-properties-by-list.xml +++ phpdoc-fr/reference/objaggregation/functions/aggregate-properties-by-list.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.aggregate-properties-by-list"> <refnamediv> <refname>aggregate_properties_by_list</refname> <refpurpose> Aggrège sélectivement les propriétés d'une classe grâce à une liste </refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>void</type><methodname>aggregate_properties_by_list</methodname> <methodparam><type>object</type><parameter>object</parameter></methodparam> <methodparam><type>string</type><parameter>class_name</parameter></methodparam> <methodparam><type>array</type><parameter>properties_list</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>exclude</parameter></methodparam> </methodsynopsis> <para> <function>aggregate_properties_by_list</function> aggrège les propriétés de la classe <parameter>class_name</parameter> avec l'objet <parameter>object</parameter>, en filtrant les propriétés aggrégées grâce à la liste <parameter>methods_list</parameter>, appliquée au nom de la propriété. Le paramètre optionnel <parameter>exclude</parameter> sert à décider si l'expression régulière sélectionne les propriétés ( <parameter>exclude</parameter> vaut &false; sa valeur par défaut), ou bien si elle sert à identifier les propriétés qui doivent être exclues (<parameter>exclude</parameter> vaut &true;). </para> <para> Les propriétés dont le nom commence par un caractère souligné ("_"), qui sont considérées comme privées, sont toujours exclues. </para> <simpara> Voir aussi <function>aggregate</function>, <function>aggregate_methods</function>, <function>aggregate_methods_by_list</function>, <function>aggregate_methods_by_regexp</function>, <function>aggregate_properties</function>, <function>aggregate_properties_by_regexp</function>, <function>aggregate_info</function>, <function>deaggregate</function> </simpara> </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 --> Index: phpdoc-fr/reference/objaggregation/functions/aggregate-properties-by-regexp.xml +++ phpdoc-fr/reference/objaggregation/functions/aggregate-properties-by-regexp.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.aggregate-properties-by-regexp"> <refnamediv> <refname>aggregate_properties_by_regexp</refname> <refpurpose> Aggrège sélectivement les propriétés d'une classe grâce à une expression régulière </refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>void</type><methodname>aggregate_properties_by_regexp</methodname> <methodparam><type>object</type><parameter>object</parameter></methodparam> <methodparam><type>string</type><parameter>class_name</parameter></methodparam> <methodparam><type>string</type><parameter>regexp</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>exclude</parameter></methodparam> </methodsynopsis> <para> <function>aggregate_properties_by_regexp</function> aggrège les propriétés de la classe <parameter>class_name</parameter> avec l'objet <parameter>object</parameter>, en filtrant les propriétés aggrégées grâce à l'expression régulière <parameter>regexp</parameter>, appliquée au nom de la propriétés. Le paramètre optionnel <parameter>exclude</parameter> sert à décider si l'expression régulière sélectionne les propriétés (<parameter>exclude</parameter> vaut &false; sa valeur par défaut), ou bien si elle sert à identifier les propriétés qui doivent être exclues (<parameter>exclude</parameter> vaut &true;). </para> <para> Les propriétés dont le nom commence par un caractère souligné ("_"), qui sont considérées comme privées, sont toujours exclues. </para> <simpara> Voir aussi <function>aggregate</function>, <function>aggregate_methods</function>, <function>aggregate_methods_by_list</function>, <function>aggregate_methods_by_regexp</function>, <function>aggregate_properties</function>, <function>aggregate_properties_by_list</function>, <function>aggregate_info</function> et <function>deaggregate</function> </simpara> </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 -->