src/snac/server/database/SQL.php
/**
     * Update a version_history record
     *
     * Get a new version but keeping the existing ic_id. This also uses DatabaseConnector->query() in an
     * attempt to be more efficient, or perhaps just less verbose.
     *
     * @param integer $appUserID Foreign key to appuser.id, the current user's appuser id value.
     *
     * @param integer $roleID Foreign key to role.id, the role id value of the current user.
     *
     * @param string $status Status value from the enum icstatus. Using an enum from the db is a bit obscure
     * to all the php code, so maybe best to move icstatus to some util class and have a method to handle
     * these. Or a method that knows about the db class, but can hide the details from the application
     * code. Something.
     *
     * @param string $note A string the user enters to identify what changed in this version.
     *
     * @param integer $ic_id Constellation id
     *
     * @return string[] $vhInfo An assoc list with keys 'version', 'ic_id'.
     */
Update a version_history record
Get a new version but keeping the existing ic_id. This also uses DatabaseConnector->query() in an
attempt to be more efficient, or perhaps just less verbose.

@param integer $appUserID Foreign key to appuser.id, the current user's appuser id value.

@param integer $roleID Foreign key to role.id, the role id value of the current user.

@param string $status Status value from the enum icstatus. Using an enum from the db is a bit obscure
to all the php code, so maybe best to move icstatus to some util class and have a method to handle
these. Or a method that knows about the db class, but can hide the details from the application
code. Something.

@param string $note A string the user enters to identify what changed in this version.

@param integer $ic_id Constellation id

@return string[] $vhInfo An assoc list with keys 'version', 'ic_id'.
Update a version_history record Get a new version but keeping the existing ic_id . This also uses DatabaseConnector - > query () in an attempt to be more efficient or perhaps just less verbose . @param integer $appUserID Foreign key to appuser . id the current user ' s appuser id value . @param integer $roleID Foreign key to role . id the role id value of the current user . @param string $status Status value from the enum icstatus . Using an enum from the db is a bit obscure to all the php code so maybe best to move icstatus to some util class and have a method to handle these . Or a method that knows about the db class but can hide the details from the application code . Something . @param string $note A string the user enters to identify what changed in this version . @param integer $ic_id Constellation id @return string [] $vhInfo An assoc list with keys ' version ' ' ic_id ' .
public function updateVersionHistory($appUserID, $roleID, $status, $note, $ic_id)
    {
        $result = $this->sdb->query('insert into version_history
                                    (id, user_id, role_id, status, is_current, note)
                                    values
                                    ($1, $2, $3, $4, $5, $6)
                                    returning version',
                                    array($ic_id, $appUserID, $roleID, $status, true, $note));
        $row = $this->sdb->fetchrow($result);
        return $row['version'];
    }
public function updateVersionHistory ( $ appUserID , $ roleID , $ status , $ note , $ ic_id ) { $ result = $ this -> sdb -> query ( 'insert into version_history
                                    (id, user_id, role_id, status, is_current, note)
                                    values
                                    ($1, $2, $3, $4, $5, $6)
                                    returning version' , array ( $ ic_id , $ appUserID , $ roleID , $ status , true , $ note ) ) ; $ row = $ this -> sdb -> fetchrow ( $ result ) ; return $ row [ 'version' ] ; }
Update a version_history record
 Get a new version but keeping the existing ic_id.
Update a version_history record Get a new version but keeping the existing ic_id .
/*
         * Note: query() as opposed to prepare() and execute()
         * query() has two args:
         * 1) a string (sql query)
         * 2) an array of the vars that match the query placeholders
         *
         */