Collection
extends AbstractCollection
in package
FinalYes
Table of Contents
Properties
Methods
- __construct() : mixed
- 新しいオブジェクトを作成します。
- add() : bool
- オブジェクトを追加します
- clear() : void
- 配列をクリアします
- isEmpty() : bool
- 配列が空であることを確認します。
- isNotEmpty() : bool
- 配列が空でないことを確認します。
- remove() : bool
- オブジェクトを削除します
- size() : int
- 配列のサイズを取得します。
- toArray() : array<string|int, mixed>
- オブジェクトを配列で取得します。
Properties
$objects
protected
array<string|int, mixed>
$objects
= []
$typeName
private
string
$typeName
型名またはクラス名
Methods
__construct()
新しいオブジェクトを作成します。
public
__construct(string $typeName) : mixed
Parameters
- $typeName : string
add()
オブジェクトを追加します
public
add(mixed $object) : bool
Parameters
- $object : mixed
-
追加するオブジェクトを渡します
Tags
Return values
bool —成功した場合はtrueを返します
clear()
配列をクリアします
public
clear() : void
isEmpty()
配列が空であることを確認します。
public
isEmpty() : bool
Return values
bool —配列が空の場合はtrue、それ以外はfalseを返します
isNotEmpty()
配列が空でないことを確認します。
public
isNotEmpty() : bool
Return values
bool —配列が空でない場合はtrue、それ以外はfalseを返します
remove()
オブジェクトを削除します
public
remove(mixed $object) : bool
Parameters
- $object : mixed
-
削除するオブジェクトを渡します
Tags
Return values
bool —オブジェクトを削除できた場合はtrueを返します
size()
配列のサイズを取得します。
public
size() : int
Return values
int —配列のサイズを返します
toArray()
オブジェクトを配列で取得します。
public
toArray() : array<string|int, mixed>