final public function swapEntity($tag, BaseInterface $entity)
    {
        if (!isset($this->entities[$tag])) {
            throw new \RuntimeException("Unable to swap entity that does not exist");
        }
        $this->entities[$tag] = $entity;
        $entity->setFormTag($tag);
        $this->getEventManager()
            ->trigger(self::EVENT_CONFIGURE_ENTITY.$tag, $this, array(
                'tag' => $tag,
                'entity' => $entity,
                'entities' => $this->getEntities(),
            ));

        return $this;
    }