private void removeLayouts(ArrayList<Integer> ids) { DatabaseAdapter databaseAdapter = new DatabaseAdapter(this.fragment.getActivity()); for (Integer id : ids) { databaseAdapter.deleteLayout(id); } }
private void insertLayouts(ArrayList<LayoutDatabase> layouts) { DatabaseAdapter databaseAdapter = new DatabaseAdapter(this.fragment.getActivity()); for (LayoutDatabase layout : layouts) { databaseAdapter.insertLayout(layout); } }
private void findAndRemoveImages(int layoutId) { DatabaseAdapter databaseAdapter = new DatabaseAdapter(this.fragment.getActivity()); LayoutDatabase layout = databaseAdapter.getLayoutDatabase(layoutId); if (isTypeWithContent(layout.getType()) && !layout.getContentEn().isEmpty()) { findAndRemoveImagesFromContent(layout.getContentEn()); } if (isTypeWithContent(layout.getType()) && !layout.getContentPl().isEmpty()) { findAndRemoveImagesFromContent(layout.getContentPl()); } if (isTypeWithContent(layout.getType()) && !layout.getAdditionalEn().isEmpty()) { findAndRemoveImagesFromContent(layout.getAdditionalEn()); } if (isTypeWithContent(layout.getType()) && !layout.getAdditionalPl().isEmpty()) { findAndRemoveImagesFromContent(layout.getAdditionalPl()); } }
private ArrayList<Pair<Integer, Integer>> getAllLayoutsVersions() { DatabaseAdapter databaseAdapter = new DatabaseAdapter(this.fragment.getActivity()); ArrayList<Pair<Integer, Integer>> allLayoutsVersions = databaseAdapter.getAllLayoutsVersions(); return allLayoutsVersions; }