src/snac/server/database/SQL.php
/**
     * Insert a record into table source.
     *
     * Write a source objec to the database. These are per-constellation so they have ic_id and no foreign
     * keys. These are linked to other tables by putting a source.id foreign key in that related table.
     * Language related is a Language object, and is saved in table language. It is related where
     * source.id=language.fk_id. There is no language_id in table source, and there should not be. However, a
     * lanugage may link to this source record via source.id. See DBUtil writeSource().
     * The "type" field was always "simple" and is no longer used.
     *
     *
     * @param string[] $vhInfo associative list with keys: version, ic_id
     *
     * @param integer $id Record id
     *
     * @param string $displayName The name of the source to display in the UI
     *
     * @param string $text Text of this source.
     *
     * @param string $note Note about this source.
     *
     * @param string $uri URI of this source
     *
     * @return integer The id value of this record. Sources have a language, so we need to return the $id
     * because it is used by language as a foreign key.
     *
     */
Insert a record into table source.
Write a source objec to the database. These are per-constellation so they have ic_id and no foreign
keys. These are linked to other tables by putting a source.id foreign key in that related table.
Language related is a Language object, and is saved in table language.

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

@param integer $id Record id

@param string $displayName The name of the source to display in the UI

@param string $text Text of this source.

@param string $note Note about this source.

@param string $uri URI of this source

@return integer The id value of this record. Sources have a language, so we need to return the $id
because it is used by language as a foreign key.
Insert a record into table source . Write a source objec to the database . These are per - constellation so they have ic_id and no foreign keys . These are linked to other tables by putting a source . id foreign key in that related table . Language related is a Language object and is saved in table language . @param string [] $vhInfo associative list with keys : version ic_id @param integer $id Record id @param string $displayName The name of the source to display in the UI @param string $text Text of this source . @param string $note Note about this source . @param string $uri URI of this source @return integer The id value of this record . Sources have a language so we need to return the $id because it is used by language as a foreign key .
public function insertSource($vhInfo, $id, $displayName, $text, $citation, $note, $uri)
    {
        if (! $id)
        {
            $id = $this->selectID();
        }
        $qq = 'insert_source';
        $this->sdb->prepare($qq,
                            'insert into source
                            (version, ic_id, id, display_name, text, citation, note, uri)
                            values
                            ($1, $2, $3, $4, $5, $6, $7, $8)');
        $this->sdb->execute($qq,
                            array($vhInfo['version'],
                                  $vhInfo['ic_id'],
                                  $id,
                                  $displayName,
                                  $text,
                                  $citation,
                                  $note,
                                  $uri));
        $this->sdb->deallocate($qq);
        return $id;
    }
public function insertSource ( $ vhInfo , $ id , $ displayName , $ text , $ citation , $ note , $ uri ) { if ( ! $ id ) { $ id = $ this -> selectID ( ) ; } $ qq = 'insert_source' ; $ this -> sdb -> prepare ( $ qq , 'insert into source
                            (version, ic_id, id, display_name, text, citation, note, uri)
                            values
                            ($1, $2, $3, $4, $5, $6, $7, $8)' ) ; $ this -> sdb -> execute ( $ qq , array ( $ vhInfo [ 'version' ] , $ vhInfo [ 'ic_id' ] , $ id , $ displayName , $ text , $ citation , $ note , $ uri ) ) ; $ this -> sdb -> deallocate ( $ qq ) ; return $ id ; }
Insert a record into table source.
Insert a record into table source .