src/snac/server/database/SQL.php
/**
     * Select a related identity
     *
     * Related identity aka cpf relation. Code in DBUtils turns the returned array into a
     * ConstellationRelation object.
     *
     * @param string[] $vhInfo associative list with keys: version, ic_id
     *
     * @return string[][] Return a list of lists. There may be multiple relations. Each relation has keys: id,
     * version, ic_id, related_id, related_ark, relation_entry, descriptive_node, relation_type, role,
     * arcrole, date.
     *
     */
Select a related identity
Related identity aka cpf relation. Code in DBUtils turns the returned array into a
ConstellationRelation object.

@param string[] $vhInfo associative list with keys: version, ic_id

@return string[][] Return a list of lists. There may be multiple relations.
Select a related identity Related identity aka cpf relation . Code in DBUtils turns the returned array into a ConstellationRelation object . @param string [] $vhInfo associative list with keys : version ic_id @return string [] [] Return a list of lists . There may be multiple relations .
public function selectRelation($vhInfo)
    {
        $qq = 'selectrelatedidentity';
        $this->sdb->prepare($qq,
                            'select
                            aa.id, aa.version, aa.ic_id, aa.related_id, aa.related_ark,
                            aa.relation_entry, aa.descriptive_note, aa.relation_type,
                            aa.role,
                            aa.arcrole
                            from related_identity as aa,
                            (select id, max(version) as version from related_identity where version<=$1 and ic_id=$2 group by id) as bb
                            where not aa.is_deleted and
                            aa.id=bb.id
                            and aa.version=bb.version');
        $result = $this->sdb->execute($qq,
                                      array($vhInfo['version'],
                                            $vhInfo['ic_id']));
        $all = array();
        while ($row = $this->sdb->fetchrow($result))
        {
            array_push($all, $row);
        }
        $this->sdb->deallocate($qq);
        return $all;
    }
public function selectRelation ( $ vhInfo ) { $ qq = 'selectrelatedidentity' ; $ this -> sdb -> prepare ( $ qq , 'select
                            aa.id, aa.version, aa.ic_id, aa.related_id, aa.related_ark,
                            aa.relation_entry, aa.descriptive_note, aa.relation_type,
                            aa.role,
                            aa.arcrole
                            from related_identity as aa,
                            (select id, max(version) as version from related_identity where version<=$1 and ic_id=$2 group by id) as bb
                            where not aa.is_deleted and
                            aa.id=bb.id
                            and aa.version=bb.version' ) ; $ result = $ this -> sdb -> execute ( $ qq , array ( $ vhInfo [ 'version' ] , $ vhInfo [ 'ic_id' ] ) ) ; $ all = array ( ) ; while ( $ row = $ this -> sdb -> fetchrow ( $ result ) ) { array_push ( $ all , $ row ) ; } $ this -> sdb -> deallocate ( $ qq ) ; return $ all ; }
Select a related identity
 Related identity aka cpf relation.
Select a related identity Related identity aka cpf relation .