code: protected function getIdStorebyStoreName(string $storeName): int
      {
  
          $storeEntity = SpyStoreQuery::create()
              ->filterByName($storeName)
              ->findOne();
  
          if ($storeEntity == null) {
              return 0;
          }
          
          return $storeEntity->getIdStore();
      }
docs: @param string $storeName
  
  @return int