code: public function getAllModules()
      {
          $modules = [];
          $moduleCollection = $this->collectionFactory->create()->getData();
          foreach ($moduleCollection as $module) {
              $modules[] = $module;
          }
          return $modules;
      }
docs: Returns all module data from database
  
  @return array