public function detach($entity) {
        if (!is_string($entity) && !is_object($entity))
            throw new \Exception('Entity must be a string or an object');

        if (is_object($entity)) {
            if (!$entity instanceof Entity)
                throw new \Exception('Entity must an instance of MidiChloriansPHP\mvc\model\Entity');

            $entity = $this->getEntityHash($entity);
        }

        if ($this->isAttached($entity))
            unset($this->_entities[$entity]);
    }