src/snac/server/database/DBUtil.php
/**
     * Undelete a constellation. (Broken)
     *
     * The code below fails to distinguish constellation from data, and instead does both things, which makes
     * no sense.
     *
     * This should do to separate things depending on what is being undeleted, but "what is being undeleted"
     * is not handled properly. Constellations are undeleted via writeConstellationStatus().
     *
     * Data is undeleted via sqlClearDeleted() however, we must not undelete data for a constellation that is
     * currently deleted.
     *
     * @param \snac\data\User $user The user performing the undelete
     *
     * @param integer $roleID The current integer role.id value of the user. Comes from role.id and table appuser_role_link.
     *
     * @param string $icstatus Status of this record. Pass a null if unchanged. Lower level code will preserved the existing setting.
     *
     * @param string $note A user-created note for what was done to the constellation. A check-in note.
     *
     * @param integer $ic_id The constellation id.
     *
     * @param string $table Name of the table we are deleting from.
     *
     * @param integer $id The record id of the record being deleted. Corresponds to table.id.
     *
     * @return string Non-null is success, null is failure. On succeess returns the deleted row id, which
     * should be the same as $id.
     *
     */
Undelete a constellation. (Broken)
The code below fails to distinguish constellation from data, and instead does both things, which makes
no sense.

This should do to separate things depending on what is being undeleted, but "what is being undeleted"
is not handled properly. Constellations are undeleted via writeConstellationStatus().

Data is undeleted via sqlClearDeleted() however, we must not undelete data for a constellation that is
currently deleted.

@param \snac\data\User $user The user performing the undelete

@param integer $roleID The current integer role.id value of the user. Comes from role.id and table appuser_role_link.

@param string $icstatus Status of this record. Pass a null if unchanged. Lower level code will preserved the existing setting.

@param string $note A user-created note for what was done to the constellation. A check-in note.

@param integer $ic_id The constellation id.

@param string $table Name of the table we are deleting from.

@param integer $id The record id of the record being deleted.

@return string Non-null is success, null is failure. On succeess returns the deleted row id, which
should be the same as $id.
Undelete a constellation . ( Broken ) The code below fails to distinguish constellation from data and instead does both things which makes no sense . This should do to separate things depending on what is being undeleted but " what is being undeleted " is not handled properly . Constellations are undeleted via writeConstellationStatus () . Data is undeleted via sqlClearDeleted () however we must not undelete data for a constellation that is currently deleted . @param \ snac \ data \ User $user The user performing the undelete @param integer $roleID The current integer role . id value of the user . Comes from role . id and table appuser_role_link . @param string $icstatus Status of this record . Pass a null if unchanged . Lower level code will preserved the existing setting . @param string $note A user - created note for what was done to the constellation . A check - in note . @param integer $ic_id The constellation id . @param string $table Name of the table we are deleting from . @param integer $id The record id of the record being deleted . @return string Non - null is success null is failure . On succeess returns the deleted row id which should be the same as $id .
public function clearDeleted($user, $roleID, $icstatus, $note, $ic_id, $table, $id)
    {
        if ($user == null || $user->getUserID() == null) {
            return null;
        }
        if (! isset($this->canDelete[$table]))
        {
            $this->logDebug(sprintf("Cannot clear deleted on table: $table"));
            return null;
        }
        $newVersion = $this->sql->updateVersionHistory($user->getUserID(), $roleID, $icstatus, $note, $ic_id);
        $this->sql->sqlClearDeleted($table, $id, $newVersion);
        return $newVersion;
    }
public function clearDeleted ( $ user , $ roleID , $ icstatus , $ note , $ ic_id , $ table , $ id ) { if ( $ user == null || $ user -> getUserID ( ) == null ) { return null ; } if ( ! isset ( $ this -> canDelete [ $ table ] ) ) { $ this -> logDebug ( sprintf ( " Cannot clear deleted on table:  $ table " ) ) ; return null ; } $ newVersion = $ this -> sql -> updateVersionHistory ( $ user -> getUserID ( ) , $ roleID , $ icstatus , $ note , $ ic_id ) ; $ this -> sql -> sqlClearDeleted ( $ table , $ id , $ newVersion ) ; return $ newVersion ; }
Undelete a constellation.
Undelete a constellation .
// Warn the user and write into the log.