src/snac/server/database/SQL.php
/**
     * Select All Languages for Resource
     * @param  int $rid     Resource ID to look up
     * @param  int $version Version number for the resource
     * @return string[][]          Array of resource language data
     */
Select All Languages for Resource
@param  int $rid     Resource ID to look up
@param  int $version Version number for the resource
@return string[][]          Array of resource language data
Select All Languages for Resource @param int $rid Resource ID to look up @param int $version Version number for the resource @return string [] [] Array of resource language data
public function selectAllLanguagesForResource($rid, $version)
    {
        $qq = 'select_language';
        $query = 'select aa.version, aa.resource_id, aa.id, aa.language_id, aa.script_id, aa.vocabulary_source, aa.note
        from resource_language as aa,
        (select id,max(version) as version from resource_language where resource_id=$1 and version<=$2 group by id) as bb
        where not is_deleted and aa.id=bb.id and aa.version=bb.version';
        $this->sdb->prepare($qq, $query);
        $result = $this->sdb->execute($qq, array($rid, $version));
        $all = array();
        while($row = $this->sdb->fetchrow($result))
        {
            array_push($all, $row);
        }
        $this->sdb->deallocate($qq);
        return $all;
    }
public function selectAllLanguagesForResource ( $ rid , $ version ) { $ qq = 'select_language' ; $ query = 'select aa.version, aa.resource_id, aa.id, aa.language_id, aa.script_id, aa.vocabulary_source, aa.note
        from resource_language as aa,
        (select id,max(version) as version from resource_language where resource_id=$1 and version<=$2 group by id) as bb
        where not is_deleted and aa.id=bb.id and aa.version=bb.version' ; $ this -> sdb -> prepare ( $ qq , $ query ) ; $ result = $ this -> sdb -> execute ( $ qq , array ( $ rid , $ version ) ) ; $ all = array ( ) ; while ( $ row = $ this -> sdb -> fetchrow ( $ result ) ) { array_push ( $ all , $ row ) ; } $ this -> sdb -> deallocate ( $ qq ) ; return $ all ; }
Select All Languages for Resource
 @param  int $rid     Resource ID to look up
 @param  int $version Version number for the resource
 @return string[][]          Array of resource language data
Select All Languages for Resource @param int $rid Resource ID to look up @param int $version Version number for the resource @return string [] [] Array of resource language data