getContainer($name); } /** * createContainer * * @param string $key * @param array $value * @return Container\AbstractContainer */ public function createContainer($key, array $value = []) { $key = (string) $key; $this->items[$key] = new $this->containerClass($value); return $this->items[$key]; } /** * Retrieve a placeholder container * * @param string $key * @return Container\AbstractContainer */ public function getContainer($key) { $key = (string) $key; if (isset($this->items[$key])) { return $this->items[$key]; } $container = $this->createContainer($key); return $container; } /** * Does a particular container exist? * * @param string $key * @return bool */ public function containerExists($key) { $key = (string) $key; $return = array_key_exists($key, $this->items); return $return; } /** * Delete a specific container by name * * @param string $key * @return void */ public function deleteContainer($key) { $key = (string) $key; unset($this->items[$key]); } /** * Remove all containers * * @return void */ public function clearContainers() { $this->items = []; } }