* @param toolModelForDao
* @return Tool
*/
private Tool ToolModelForDaoToTool(ToolModelForDao toolModelForDao){
Tool tool = new Tool();
List<Category> tags = new ArrayList<Category>();
List<MapDescription> description = new ArrayList<MapDescription>();
MapDescription descriptionAr = new MapDescription();
MapDescription descriptionEn = new MapDescription();
MapDescription descriptionFr = new MapDescription();
descriptionAr.setLang(ApplicationConstants.LANG_AR_AR);
descriptionAr.setText(toolModelForDao.getDescription().get(ApplicationConstants.LANG_AR_AR));
descriptionEn.setLang(ApplicationConstants.LANG_EN_US);
descriptionEn.setText(toolModelForDao.getDescription().get(ApplicationConstants.LANG_EN_US));
descriptionFr.setLang(ApplicationConstants.LANG_FR_FR);
descriptionFr.setText(toolModelForDao.getDescription().get(ApplicationConstants.LANG_FR_FR));
for(String tag : toolModelForDao.getTags()){
tags.add(new Category(tag));
}
tool.setId(toolModelForDao.getId());
tool.setTitle(toolModelForDao.getTitle());
tool.setTags(tags);
tool.setDescription(description);
tool.setPublishedDate(new Date());
tool.setImage(toolModelForDao.getImage());
return tool;
}