Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
PHP: オブジェクトの集約関数 - Manual
[go: Go Back, main page]

PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

aggregate_info" width="11" height="7"/> <Object Aggregation
Last updated: Fri, 29 Aug 2008

view this page in

オブジェクトの集約関数

目次

  • aggregate_info — 指定したオブジェクトの集約情報を取得する
  • aggregate_methods_by_list — 選択したクラスメソッドを、動的にオブジェクトに集約する
  • aggregate_methods_by_regexp — 正規表現を使用して選択したクラスメソッドを、 動的にオブジェクトに集約する
  • aggregate_methods — クラスのメソッドを、動的にオブジェクトに集約する
  • aggregate_properties_by_list — 選択したクラスプロパティを、動的にオブジェクトに集約する
  • aggregate_properties_by_regexp — 正規表現を使用して選択したクラスプロパティを、 動的にオブジェクトに集約する
  • aggregate_properties — クラスのプロパティを、動的にオブジェクトに集約する
  • aggregate — メソッドおよびプロパティの動的なクラス/オブジェクト集約を行う
  • aggregation_info — aggregate_info のエイリアス
  • deaggregate — 集約されたメソッドやプロパティをオブジェクトから取り除く


add a note add a note User Contributed Notes
オブジェクトの集約関数
kencomer at NOSPAM dot kencomer dot com
21-Sep-2005 01:04
For PHP5 applications, the all of the "aggregate" function family is now in runkit.

  http://php.net/manual/en/ref.runkit.php
Jeb.
17-Jan-2003 07:18
It is worth noting that class association does not work, even in PHP 4.3.0 - this ability is experimental. I'm assuming it was added in for the sake of forwards-compatibilty. Use object association instead for now.

Until it is implemented, you will receieve a parse error when attempting to use it.

Related bug report: http://bugs.php.net/bug.php?id=20531

Just to prevent people posting about "why it doesn't work??", etc etc etc.
Greg Beaver firstname at chiaraquartet dot net
05-Jan-2003 08:54
If you need to serialize an object for sessions or other purposes, and want to save aggregation state, extend it from a base class such as this one, and use $this->agg/$this->unagg instead of aggregate/deaggregate

<?php
class base
{
    var
$_aggregates = array();
   
    function
agg($agg)
    {
       
aggregate($this,$agg);
       
$this->_aggregates[$agg] = 1;
    }
   
    function
unagg($agg = false)
    {
        if (
$agg)
        {
            
deaggregate($this,$agg);
             unset(
$this->_aggregates[$agg]);
        } else
        {
            
deaggregate($this);
           
$this->_aggregates = array();
        }
    }
}
?>

 
show source | credits | sitemap | contact | advertising | mirror sites