public function setContainerObj($obj)
    {
        if ($obj === null) {
            $this->containerObj = null;

            return $this;
        }

        if (!$obj instanceof AttachmentContainerInterface) {
            throw new InvalidArgumentException(sprintf(
                'Container object must be an instance of %s; received %s',
                AttachmentContainerInterface::class,
                (is_object($obj) ? get_class($obj) : gettype($obj))
            ));
        }

        if (!$obj->id()) {
            throw new InvalidArgumentException(sprintf(
                'Container object must have an ID.',
                (is_object($obj) ? get_class($obj) : gettype($obj))
            ));
        }

        $this->containerObj = $obj;

        return $this;
    }