src/snac/server/database/SQL.php
/**
     * Insert meta record
     *
     * Inset meta related to the $fk_id. Table scm, php object SNACControlMetadata.
     *
     * Note: we do not use citation_id because citations are source, and source is not a controlled
     * vocabulary. Source is like date. Each source is indivualized for the record it relates to. To get the
     * citation, conceptual select from source where scm.id==source.fk_id.
     *
     * Note: We do not save language_id because languages are objects, not a single vocabulary term like
     * $ruleID. The language is related back to this table where scm.id=language.fk_id and
     * scm.version=language.version. (Or something like that with version. It might be complicated.)
     *
     * @param string[] $vhInfo associative list with keys: version, ic_id
     *
     * @param integer $id Record id of this table.
     *
     * @param integer $citationID Foreign key to table source.id
     *
     * @param string $subCitation A sub citation
     *
     * @param string $sourceData The text of the source
     *
     * @param integer $ruleID fk to vocaulary.id
     *
     * @param string $note A note about this meta data
     *
     * @param string $fkTable name of the related table
     *
     * @param integer $fkID fk to the relate table
     *
     * @return integer Return the record id
     */
Insert meta record
Inset meta related to the $fk_id. Table scm, php object SNACControlMetadata.

we do not use citation_id because citations are source, and source is not a controlled
vocabulary. Source is like date. Each source is indivualized for the record it relates to. To get the
citation, conceptual select from source where scm.id==source.fk_id.

We do not save language_id because languages are objects, not a single vocabulary term like
$ruleID.

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

@param integer $id Record id of this table.

@param integer $citationID Foreign key to table source.id

@param string $subCitation A sub citation

@param string $sourceData The text of the source

@param integer $ruleID fk to vocaulary.id

@param string $note A note about this meta data

@param string $fkTable name of the related table

@param integer $fkID fk to the relate table

@return integer Return the record id
Insert meta record Inset meta related to the $fk_id . Table scm php object SNACControlMetadata . we do not use citation_id because citations are source and source is not a controlled vocabulary . Source is like date . Each source is indivualized for the record it relates to . To get the citation conceptual select from source where scm . id == source . fk_id . We do not save language_id because languages are objects not a single vocabulary term like $ruleID . @param string [] $vhInfo associative list with keys : version ic_id @param integer $id Record id of this table . @param integer $citationID Foreign key to table source . id @param string $subCitation A sub citation @param string $sourceData The text of the source @param integer $ruleID fk to vocaulary . id @param string $note A note about this meta data @param string $fkTable name of the related table @param integer $fkID fk to the relate table @return integer Return the record id
public function insertMeta($vhInfo, $id, $citationID, $subCitation, $sourceData,
                               $ruleID, $note, $fkTable, $fkID)
    {
        if (! $id)
        {
            $id = $this->selectID();
        }
        $qq = 'insert_meta';
        $this->sdb->prepare($qq,
                            'insert into scm
                            (version, ic_id, id, citation_id, sub_citation, source_data,
                            rule_id, note, fk_id, fk_table)
                            values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)');
        $result = $this->sdb->execute($qq,
                                      array($vhInfo['version'],
                                            $vhInfo['ic_id'],
                                            $id,
                                            $citationID,
                                            $subCitation,
                                            $sourceData,
                                            $ruleID,
                                            $note,
                                            $fkID,
                                            $fkTable));
        $row = $this->sdb->fetchrow($result);
        $this->sdb->deallocate($qq);
        return $id;
    }
public function insertMeta ( $ vhInfo , $ id , $ citationID , $ subCitation , $ sourceData , $ ruleID , $ note , $ fkTable , $ fkID ) { if ( ! $ id ) { $ id = $ this -> selectID ( ) ; } $ qq = 'insert_meta' ; $ this -> sdb -> prepare ( $ qq , 'insert into scm
                            (version, ic_id, id, citation_id, sub_citation, source_data,
                            rule_id, note, fk_id, fk_table)
                            values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)' ) ; $ result = $ this -> sdb -> execute ( $ qq , array ( $ vhInfo [ 'version' ] , $ vhInfo [ 'ic_id' ] , $ id , $ citationID , $ subCitation , $ sourceData , $ ruleID , $ note , $ fkID , $ fkTable ) ) ; $ row = $ this -> sdb -> fetchrow ( $ result ) ; $ this -> sdb -> deallocate ( $ qq ) ; return $ id ; }
Insert meta record
 Inset meta related to the $fk_id.
Insert meta record Inset meta related to the $fk_id .