/**
  * Updates an element
  * @param Element $element The element to update
  * @return int The affected rows number
  */
 public static function updateElement($element)
 {
     $logInstance = LogTool::getInstance();
     $logInstance->unsetSilentMode();
     //TODO: manage logs for tables with both id (_has_ tables)
     $logInstance->logDebug('Updates ' . $element->getElementClass() . ' element with id #' . $element->id);
     // Updates element in database
     $affectedRowNumber = DatabaseFactory::updateElement($element);
     // Updates element in cache
     ///CacheFactory::updateElement($element);
     return $affectedRowNumber;
 }