/**
  * Check if address may get deleted.
  *
  * @param int $uid Uid
  * @param AddressesController|DataHandler $parentObject Parent object
  *
  * @return bool|string
  */
 public static function checkDelete($uid, $parentObject)
 {
     /**
      * Frontend user repository.
      *
      * @var FrontendUserRepository
      */
     $userRepository = GeneralUtility::makeInstance('CommerceTeam\\Commerce\\Domain\\Repository\\FrontendUserRepository');
     $frontendUser = $userRepository->findByAddressId((int) $uid);
     // no errormessage
     $msg = false;
     // check dependencies (selected rows)
     if (!empty($frontendUser)) {
         // errormessage
         if ($parentObject instanceof AddressesController) {
             $msg = $parentObject->pi_getLL('error_deleted_address_is_default');
         }
         if ($parentObject instanceof DataHandler) {
             $msg = self::getLanguageService()->sl('LLL:EXT:commerce/Resources/Private/Language/locallang.xml:error_deleted_address_is_default');
         }
     }
     return $msg;
 }