# Zhamao Framework: Container类 参考

Container类 参考
类 Container 继承关系图:
[图例]
Container 的协作图:
[图例]

## Public 成员函数

| getParent ()
| has (string $id)
| make (string $abstract, array $parameters=[])
Public 成员函数 继承自 ContainerInterface
| bound (string $abstract)
| alias (string $abstract, string $alias)
| bind (string $abstract, $concrete=null, bool $shared=false)
| bindIf (string $abstract, $concrete=null, bool $shared=false)
| singleton (string $abstract, $concrete=null)
| singletonIf (string $abstract, $concrete=null)
| instance (string $abstract, $instance)
| factory (string $abstract)
| flush ()
| call (callable $callback, array $parameters=[], string $default_method=null)

## 成员函数说明

## getParent()

getParent | ( |  | ) |

获取父容器

## has()

has | ( | string | $id | ) |

Returns true if the container can return an entry for the given identifier. Returns false otherwise.

`has($id)` returning true does not mean that `get($id)` will not throw an exception. It does however mean that `get($id)` will not throw a `NotFoundExceptionInterface`.

参数

  string | $id | identifier of the entry to look for

函数调用图:

## make()

make | ( | string | $abstract,
|  | array | $parameters = `[]`
| ) |  |

获取一个绑定的实例

@template T

参数

  | class-string<T> | $abstract 类或接口名
  array | $parameters | 参数

返回
  Closure|mixed|T 实例

异常

  EntryResolutionException |

实现了 ContainerInterface.

函数调用图:

该类的文档由以下文件生成:

- src/ZM/Container/Container.php