public function delete()
    {
        $list = StorageLocation::getList();
        foreach ($list as $item) {
            if ($item->getTypeObject()->getHandle() == $this->getHandle()) {
                throw new \Exception(t('Please remove all storage locations using this storage type.'));
            }
        }

        $em = \ORM::entityManager();
        $em->remove($this);
        $em->flush();

        return true;
    }