src/snac/server/database/DBUtil.php
/**
     * Read published by ID
     *
     * Read a published constellation by constellation ID (aka ic_id, mainID) from the database.  If the constellation has ever been
     * split, it will return false.  This method will only return a constellation if the Ark given
     * only references one published constellation.
     *
     * Use the optional flags to get only a partial constellation.  The flags are a bit mask, and can
     * be ORed together.  Certain shortcut flags are available, such as:
     *
     * ```
     * $FULL_CONSTELLATION = $READ_NRD | $READ_ALL_NAMES | $READ_BIOGHIST
     *                       | $READ_BIOGHIST | $READ_RELATIONS
     *                       | $READ_OTHER_EXCEPT_RELATIONS
     * $READ_SHORT_SUMMARY = $READ_NRD | $READ_PREFERRED_NAME | $READ_BIOGHIST
     * ```
     *
     * @param integer $mainID A constellation id
     * @param int $flags optional Flags to indicate which parts of the constellation to read
     *
     * @return \snac\data\Constellation A PHP constellation object.
     */
Read published by ID
Read a published constellation by constellation ID (aka ic_id, mainID) from the database.  If the constellation has ever been
split, it will return false.  This method will only return a constellation if the Ark given
only references one published constellation.

Use the optional flags to get only a partial constellation.  The flags are a bit mask, and can
be ORed together.  Certain shortcut flags are available, such as.



@param integer $mainID A constellation id
@param int $flags optional Flags to indicate which parts of the constellation to read

@return \snac\data\Constellation A PHP constellation object.
Read published by ID Read a published constellation by constellation ID ( aka ic_id mainID ) from the database . If the constellation has ever been split it will return false . This method will only return a constellation if the Ark given only references one published constellation . Use the optional flags to get only a partial constellation . The flags are a bit mask and can be ORed together . Certain shortcut flags are available such as . @param integer $mainID A constellation id @param int $flags optional Flags to indicate which parts of the constellation to read @return \ snac \ data \ Constellation A PHP constellation object .
public function readPublishedConstellationByID($mainID, $flags=0)
    {
        if ($mainID == null || $mainID == '') {
            return false;
        }
        $currentIDs = $this->sql->selectCurrentMainIDsForID($mainID);
        if ($currentIDs != null && count($currentIDs) == 1) {
            $currentID = $currentIDs[0];
            $version = $this->sql->selectCurrentVersionByStatus($currentID, 'published');
            if ($version)
            {
                $cObj = $this->readConstellation($currentID, $version, $flags);
                return $cObj;
            }
        }
        $this->logDebug("Warning: cannot get constellation id: $mainID");
        return false;
    }
public function readPublishedConstellationByID ( $ mainID , $ flags = 0 ) { if ( $ mainID == null || $ mainID == '' ) { return false ; } $ currentIDs = $ this -> sql -> selectCurrentMainIDsForID ( $ mainID ) ; if ( $ currentIDs != null && count ( $ currentIDs ) == 1 ) { $ currentID = $ currentIDs [ 0 ] ; $ version = $ this -> sql -> selectCurrentVersionByStatus ( $ currentID , 'published' ) ; if ( $ version ) { $ cObj = $ this -> readConstellation ( $ currentID , $ version , $ flags ) ; return $ cObj ; } } $ this -> logDebug ( " Warning: cannot get constellation id:  $ mainID " ) ; return false ; }
Read published by ID
 Read a published constellation by constellation ID (aka ic_id, mainID) from the database.
Read published by ID Read a published constellation by constellation ID ( aka ic_id mainID ) from the database .
// Redirection, in case this ID was merged into another.  Worst case, currentID = mainID. // Need to throw an exception as well? Or do we? It is possible that higher level code is rather brute // force asking for a published constellation. Returning false means the request didn't work.