/**
  * Deletes a row from a table
  * @param string $tableName
  * @param array $search
  */
 private function delete($tableName, $search)
 {
     $select = new eDB_Select();
     $rowID = $select->getRowIdBySearch($search, $tableName);
     $content = $select->search($tableName, '*');
     unset($content[$rowID - 1]);
     $cols = $select->getColumns($tableName);
     $completeContent[] = $cols;
     foreach ($content as $row) {
         $completeContent[] = $row;
     }
     $update = new eDB_Update();
     $update->updateTable($completeContent, $tableName);
 }
 /**
  * Peform an update
  * @param array $values
  * @param array $search
  * @param string $tableName
  */
 private function update($values, $search, $tableName)
 {
     $select = new eDB_Select();
     $rowID = $select->getRowIdBySearch($search, $tableName);
     $ChangedRow = $select->getRowById($rowID, $tableName);
     foreach ($values as $col => $value) {
         $ChangedRow[0][$col] = $value;
     }
     $cols = $select->getColumns($tableName, true);
     $content = $select->search($tableName, '*');
     $completeContent[] = $cols;
     foreach ($content as $row) {
         $completeContent[] = $row;
     }
     $completeContent[$rowID] = $ChangedRow[0];
     $this->updateTable($completeContent, $tableName);
 }
 /**
  * Generate array which contains primarykey and next number
  * @param string $tableName
  * @return array
  */
 private function generateIncrement($tableName)
 {
     $select = new eDB_Select();
     $cols = $select->getColumns($tableName, true);
     $keyNumber = 0;
     foreach ($cols as $col) {
         if (preg_match('#[\\w]*:key;[0-9]#i', $col)) {
             break;
         }
         $keyNumber++;
     }
     $cols[$keyNumber] = preg_replace('#(.*):key;[0-9]#i', "\$1", $cols[$keyNumber]);
     $result = $select->search($tableName, '*');
     $result[count($result) - 1][$cols[$keyNumber]]++;
     return array('key' => $cols[$keyNumber], 'value' => $result[count($result) - 1][$cols[$keyNumber]]);
 }