/**
  * Updates an element in cache
  * @param Element $element The element to update
  */
 public static function updateElement($element)
 {
     $elementClass = $element->getElementClass();
     $elementId = $element->id;
     // Updates element attributes if already cached
     if (self::isCachedElement($elementClass, $elementId)) {
         self::$cachedElementArray[$elementClass][$elementId] = $element;
     }
 }
 /**
  * Deletes an element in database
  * @param Element $element The element to delete
  */
 public static function deleteElement($element)
 {
     // Builds request string
     $elementClass = $element->getElementClass();
     $tableName = DatabaseFactory::getElementTableName($elementClass);
     $request = 'DELETE FROM ' . $tableName . ' WHERE ' . $tableName . '_id = \'' . $element->id . '\'';
     // Gets database connection instance
     $databaseConnection = $elementClass::getDatabaseConnection();
     $affectedRowNumber = $databaseConnection->deleteRequest($request);
     // Affected row number is incorrect
     if ($affectedRowNumber != 1) {
         throw new DatabaseException('Invalid affected row number while deleting ' . $elementType . ' element with id #' . $elementId);
     }
 }
 /**
  * Deletes an element
  * @param Element $element The element to delete
  */
 public static function deleteElement($element)
 {
     $logInstance = LogTool::getInstance();
     $logInstance->logDebug('Deletes ' . $element->getElementClass() . ' element with id #' . $element->id);
     // Updates element in database
     DatabaseFactory::deleteElement($element);
 }