src/snac/server/database/DBUtil.php
/**
     * Read the status of a constellation.
     *
     * Read the status of a constellation, with optional version. If version is not supplied, then the most
     * recent version is used.  If the version number is negative, then it will read the status of that many
     * versions back in the history.  For example, "-1" will read the previous version, "-2" will read two versions
     * back, etc.
     *
     * @param integer $mainID The constellation ID
     *
     * @param integer $version optional The version number, a relative number of versions prior (negative number),
     * or if null or omitted, return the status for the most recent version.
     *
     * @return string status. Return the version_history.status value.
     */
Read the status of a constellation.
Read the status of a constellation, with optional version. If version is not supplied, then the most
recent version is used.  If the version number is negative, then it will read the status of that many
versions back in the history.  For example, "-1" will read the previous version, "-2" will read two versions
back, etc.

@param integer $mainID The constellation ID

@param integer $version optional The version number, a relative number of versions prior (negative number),
or if null or omitted, return the status for the most recent version.

@return string status.
Read the status of a constellation . Read the status of a constellation with optional version . If version is not supplied then the most recent version is used . If the version number is negative then it will read the status of that many versions back in the history . For example " - 1 " will read the previous version " - 2 " will read two versions back etc . @param integer $mainID The constellation ID @param integer $version optional The version number a relative number of versions prior ( negative number ) or if null or omitted return the status for the most recent version . @return string status .
public function readConstellationStatus($mainID, $version=null)
    {
        $readVersion = false;
        if (!$version || !is_int($version)) {
            $readVersion = $this->sql->selectCurrentVersion($mainID);
        } else if ($version >= 0) {
            $readVersion = $version;
        } else {
            $versionList = $this->listAllVersions($mainID);
            $this->logger->addDebug("The versions of this constelllation are ", $versionList);
            if ((count($versionList) - 1 + $version) >= 0) {
                $readVersion = $versionList[count($versionList) - 1 + $version];
            }
        }
        if ($readVersion !== false) {
            $status = $this->sql->selectStatus($mainID, $readVersion);
            if ($status) {
                return $status;
            }
        }
        return false;
    }
public function readConstellationStatus ( $ mainID , $ version = null ) { $ readVersion = false ; if ( ! $ version || ! is_int ( $ version ) ) { $ readVersion = $ this -> sql -> selectCurrentVersion ( $ mainID ) ; } else if ( $ version >= 0 ) { $ readVersion = $ version ; } else { $ versionList = $ this -> listAllVersions ( $ mainID ) ; $ this -> logger -> addDebug ( " The versions of this constelllation are  " , $ versionList ) ; if ( ( count ( $ versionList ) - 1 + $ version ) >= 0 ) { $ readVersion = $ versionList [ count ( $ versionList ) - 1 + $ version ] ; } } if ( $ readVersion !== false ) { $ status = $ this -> sql -> selectStatus ( $ mainID , $ readVersion ) ; if ( $ status ) { return $ status ; } } return false ; }
Read the status of a constellation.
Read the status of a constellation .