mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
End of initial round of documentation for the aggregation extension.
Need to add some more examples on each function doc. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@90847 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
c21e04aedf
commit
3f623af9b1
7 changed files with 470 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.aggregate-by-list">
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<refentry id="function.aggregate-methods-by-list">
|
||||
<refnamediv>
|
||||
<refname>aggregate_methods_by_list</refname>
|
||||
<refpurpose>
|
||||
|
|
|
@ -0,0 +1,70 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.aggregate-methods-by-regexp">
|
||||
<refnamediv>
|
||||
<refname>aggregate_methods_by_regexp</refname>
|
||||
<refpurpose>
|
||||
selective class methods aggregation to an object using a regular
|
||||
expression
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>aggregate_methods_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>boolean</type><parameter>exclude</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Aggregates methods from a class to
|
||||
an existing object using a regular expresion to match method names.
|
||||
The optional paramater
|
||||
<parameter>exclude</parameter> is used to decide whether the regular
|
||||
expression will select
|
||||
the names of methods to include in the aggregation (i.e.
|
||||
<parameter>exclude</paramete> is &false;, which is the default value),
|
||||
or to exclude from the aggregation (<parameter>exclude</parameter> is
|
||||
&true;).
|
||||
</para>
|
||||
<para>
|
||||
The class constructor or methods
|
||||
whose names start with an underscore character (_), which are
|
||||
considered private to the aggregated class, are always
|
||||
excluded.
|
||||
</para>
|
||||
<simpara>
|
||||
See also
|
||||
<function>aggregate</function>,
|
||||
<function>aggregate_info</function>,
|
||||
<function>aggregate_methods</function>,
|
||||
<function>aggregate_methods_by_list</function>,
|
||||
<function>aggregate_properties</function>,
|
||||
<function>aggregate_properties_by_list</function>,
|
||||
<function>aggregate_properties_by_regexp</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
|
||||
-->
|
|
@ -0,0 +1,67 @@
|
|||
<?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>
|
||||
selective dynamic class properties aggregation to an object
|
||||
</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>boolean</type><parameter>exclude</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Aggregates properties from a class to
|
||||
an existing object using a list of property names. The optional paramater
|
||||
<parameter>exclude</parameter> is used to decide whether the list
|
||||
contains the names of class properties to include in the aggregation (i.e.
|
||||
<parameter>exclude</paramete> is &false;, which is the default value),
|
||||
or to exclude from the aggregation (<parameter>exclude</parameter> is
|
||||
&true;).
|
||||
</para>
|
||||
<para>
|
||||
The properties
|
||||
whose names start with an underscore character (_), which are
|
||||
considered private to the aggregated class, are always
|
||||
excluded.
|
||||
</para>
|
||||
<simpara>
|
||||
See also
|
||||
<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
|
||||
-->
|
|
@ -0,0 +1,70 @@
|
|||
<?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>
|
||||
selective class properties aggregation to an object using a regular
|
||||
expression
|
||||
</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>boolean</type><parameter>exclude</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Aggregates properties from a class to
|
||||
an existing object using a regular expresion to match their names.
|
||||
The optional paramater
|
||||
<parameter>exclude</parameter> is used to decide whether the regular
|
||||
expression will select
|
||||
the names of class properties to include in the aggregation (i.e.
|
||||
<parameter>exclude</paramete> is &false;, which is the default value),
|
||||
or to exclude from the aggregation (<parameter>exclude</parameter> is
|
||||
&true;).
|
||||
</para>
|
||||
<para>
|
||||
The properties
|
||||
whose names start with an underscore character (_), which are
|
||||
considered private to the aggregated class, are always
|
||||
excluded.
|
||||
</para>
|
||||
<simpara>
|
||||
See also
|
||||
<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>,
|
||||
<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
|
||||
-->
|
56
reference/objaggregation/functions/aggregate-properties.xml
Normal file
56
reference/objaggregation/functions/aggregate-properties.xml
Normal file
|
@ -0,0 +1,56 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.aggregate-properties">
|
||||
<refnamediv>
|
||||
<refname>aggregate_properties</refname>
|
||||
<refpurpose>
|
||||
dynamic aggregation of class properties to an object
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>aggregate_properties</methodname>
|
||||
<methodparam><type>object</type><parameter>object</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>class_name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Aggregates all properties defined in a class to
|
||||
an existing object, except for properties
|
||||
whose names start with an underscore character (_) which are
|
||||
considered private to the aggregated class.
|
||||
</para>
|
||||
<simpara>
|
||||
See also
|
||||
<function>aggregate</function>,
|
||||
<function>aggregate_methods</function>,
|
||||
<function>aggregate_methods_by_list</function>,
|
||||
<function>aggregate_methods_by_regexp</function>,
|
||||
<function>aggregate_properties_by_list</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
|
||||
-->
|
147
reference/objaggregation/functions/aggregation-info.xml
Normal file
147
reference/objaggregation/functions/aggregation-info.xml
Normal file
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.aggregation-info">
|
||||
<refnamediv>
|
||||
<refname>aggregation_info</refname>
|
||||
<refpurpose>
|
||||
returns an associative array of the methods and properties from
|
||||
each class that has been aggregated to the object.
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>aggregation_info</methodname>
|
||||
<methodparam><type>object</type><parameter>object</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Will return the aggretaion information for a particular object
|
||||
as an associative array of arrays of methods and properties. The
|
||||
key for the main array is the name of the aggregated class.
|
||||
</para>
|
||||
<para>
|
||||
For example the code below
|
||||
<example>
|
||||
<title>Using <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 "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>
|
||||
Will produce the output
|
||||
<informalexample>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
Array
|
||||
(
|
||||
[dicer] => Array
|
||||
(
|
||||
[methods] => Array
|
||||
(
|
||||
[0] => dice_it
|
||||
[1] => rotate
|
||||
)
|
||||
|
||||
[properties] => Array
|
||||
(
|
||||
[0] => rotation_angle
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
]]>
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
As you can see, all properties and methods of the
|
||||
<classname>Dicer</classname> class have been aggregated
|
||||
into our new object, with the exception of the class
|
||||
constructor and the method <methodname>_secret_super_dicing</methodname>
|
||||
</para>
|
||||
<simpara>
|
||||
See also
|
||||
<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>,
|
||||
<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
|
||||
-->
|
58
reference/objaggregation/functions/deaggregate.xml
Normal file
58
reference/objaggregation/functions/deaggregate.xml
Normal file
|
@ -0,0 +1,58 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.deaggregate">
|
||||
<refnamediv>
|
||||
<refname>deaggregate</refname>
|
||||
<refpurpose>
|
||||
removes the aggregated methods and properties from an object
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>object_aggregation</methodname>
|
||||
<methodparam><type>object</type><parameter>object</parameter></methodparam>
|
||||
<methodparam choice='opt'><type>string</type><parameter>class_name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Removes the methods and properties from classes that were aggregated to
|
||||
an object.
|
||||
If the optional <parameter>class_name</parameter> parameters is passed,
|
||||
only those methods and properties defined in that class are removed,
|
||||
otherwise all aggregated methods and properties are eliminated.
|
||||
</para>
|
||||
<simpara>
|
||||
See also
|
||||
<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>,
|
||||
<function>aggregate_info</function>
|
||||
</simpara>
|
||||
</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
|
||||
-->
|
Loading…
Reference in a new issue