concrete/src/Entity/File/StorageLocation/Type/Type.php
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;
    }
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;
    }
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 ; }
Removes the storage type if no configurations exist.

@throws \Exception

@return bool
Removes the storage type if no configurations exist .