src/snac/server/database/SQL.php
/**
     * Select all source id only by constellation ID
     *
     * Select only source.id values for a given constellation ID. Use this to get constellation source id
     * values, which higher level code uses inside populateSourceConstellation(), and which calls
     * populateSourceByID(). If you want full source record data, then you should use selectSourceByID().
     *
     * @param integer $mainID A foreign key to record in another table.
     *
     * @param integer $version The constellation version. For edits this is max version of the
     * constellation. For published, this is the published constellation version.
     *
     * @return string[] A list of list (records) with key 'id'
     */
Select all source id only by constellation ID
Select only source.id values for a given constellation ID. Use this to get constellation source id
values, which higher level code uses inside populateSourceConstellation(), and which calls
populateSourceByID(). If you want full source record data, then you should use selectSourceByID().

@param integer $mainID A foreign key to record in another table.

@param integer $version The constellation version. For edits this is max version of the
constellation. For published, this is the published constellation version.

@return string[] A list of list (records) with key 'id'
Select all source id only by constellation ID Select only source . id values for a given constellation ID . Use this to get constellation source id values which higher level code uses inside populateSourceConstellation () and which calls populateSourceByID () . If you want full source record data then you should use selectSourceByID () . @param integer $mainID A foreign key to record in another table . @param integer $version The constellation version . For edits this is max version of the constellation . For published this is the published constellation version . @return string [] A list of list ( records ) with key ' id '
public function selectSourceIDList($mainID, $version)
    {
        $qq = 'select_source_id_list';
        $this->sdb->prepare($qq,
                            'select aa.id
                            from source as aa,
                            (select id,max(version) as version from source where ic_id=$1 and version<=$2 group by id) as bb
                            where not is_deleted and aa.id=bb.id and aa.version=bb.version');
        $result = $this->sdb->execute($qq, array($mainID, $version));
        $all = array();
        while($row = $this->sdb->fetchrow($result))
        {
            array_push($all, $row);
        }
        $this->sdb->deallocate($qq);
        return $all;
    }
public function selectSourceIDList ( $ mainID , $ version ) { $ qq = 'select_source_id_list' ; $ this -> sdb -> prepare ( $ qq , 'select aa.id
                            from source as aa,
                            (select id,max(version) as version from source where ic_id=$1 and version<=$2 group by id) as bb
                            where not is_deleted and aa.id=bb.id and aa.version=bb.version' ) ; $ result = $ this -> sdb -> execute ( $ qq , array ( $ mainID , $ version ) ) ; $ all = array ( ) ; while ( $ row = $ this -> sdb -> fetchrow ( $ result ) ) { array_push ( $ all , $ row ) ; } $ this -> sdb -> deallocate ( $ qq ) ; return $ all ; }
Select all source id only by constellation ID
 Select only source.id values for a given constellation ID.
Select all source id only by constellation ID Select only source . id values for a given constellation ID .