mixed Config_Container::getItem (
string $type
= = null
, string $name
= = null
, mixed $content
= = null
, array $attributes
= = null
, int $index = -1
)
このメソッドはは、 指定されたパラメーターに応答する項目を発見しようとします。
このメソッドは、
タイプ'section'
のオブジェクトでのみ呼ぶことができます。
ルートががセクションであることに注意してください。
このメソッドは、再帰的でなく現在の構造を維持しようとします。
$type
項目の種類です。(directive
,
section
,
comment
, blank
...)
$name
項目名です。
$content
この内容を持つ項目を発見します。
$attributes
任意の値への属性セットを持つ項目を発見します。
$index
返されたオブジェクトリスト内の項目のインデックスです。 それがセットされない場合、 この名前を持つ最後の項目を返すでしょう。
mixed
-
発見した項目のリファレンスか、見つからない場合はFALSEを返します。
This function can not be called statically.
getItem()を使用して、項目を見つける方法上の少数の例
<?php
// will return the last directive found
$directives =& $obj->getItem('directive');
// will return the last directive found with content 'root'
$directives =& $obj->getItem('directive', null, 'root');
// will return the fourth directive with name 'bar'
$directive_bar_4 =& $obj->getItem('directive', 'bar', null, null, 4);
// will return the last section named 'foo'
$section_foo =& $obj->getItem('section', 'foo');
// will return the last section with attribute 'id' set to 'db'
$section_foo =& $obj->getItem('section', 'foo', null, array('id' => 'db'));
?>