src/CarteBlanche/App/Container.php
public function setBundle($name = null, $val = null, $force_overload = false)
    {
        if (!is_object($val)) {
            throw new DomainException(
                sprintf('A bundle entry must be an object (got "%s" for bundle "%s")!', gettype($val), $name)
            );
        }
        if (!CodeHelper::isClassInstance($val, Kernel::BUNDLE_CLASS)) {
            throw new DomainException(
                sprintf('A bundle entry must be a "%s" instance (for "%s")!', Kernel::BUNDLE_CLASS, $name)
            );
        }
        if (true===$this->instances->isEntry($name, 'bundles') && true!==$force_overload) {
            throw new InvalidArgumentException(
                sprintf('You can not over-write a container bundle (for "%s")!', $name)
            );
        }
        return $this->instances->setEntry($name,$val,'bundles');
    }
public function setBundle($name = null, $val = null, $force_overload = false)
    {
        if (!is_object($val)) {
            throw new DomainException(
                sprintf('A bundle entry must be an object (got "%s" for bundle "%s")!', gettype($val), $name)
            );
        }
        if (!CodeHelper::isClassInstance($val, Kernel::BUNDLE_CLASS)) {
            throw new DomainException(
                sprintf('A bundle entry must be a "%s" instance (for "%s")!', Kernel::BUNDLE_CLASS, $name)
            );
        }
        if (true===$this->instances->isEntry($name, 'bundles') && true!==$force_overload) {
            throw new InvalidArgumentException(
                sprintf('You can not over-write a container bundle (for "%s")!', $name)
            );
        }
        return $this->instances->setEntry($name,$val,'bundles');
    }
Global bundle setter

@param   string  $name           The bundle name to set
@param   mixed   $val            The bundle value to set
@param   bool    $force_overload Over-write an existing value ?
@return  \Patterns\Commons\Registry::setEntry()
@throws  \CarteBlanche\Exception\DomainException if `$val` is not an object
@throws  \CarteBlanche\Exception\DomainException if `$val` is not a `\CarteBlanche\App\Kernel::BUNDLE_CLASS` instance
@throws  \CarteBlanche\Exception\InvalidArgumentException if the entry is already defined and `$force_overload = false`