src/snac/server/database/SQL.php
/**
     * Insert date
     *
     * SNACDate.php has fromDateOriginal and toDateOriginal, but the CPF lacks date components, and the
     * database "original" is only the single original string.
     *
     * @param string[] $vhInfo associative list with keys: version, ic_id
     * @param integer $id Record id. If null a new one will be minted.
     * @param integer $isRange Boolean if this is a date range
     * @param string $fromDate The from date
     * @param string $fromType Type of from date, fk to vocabulary.id
     * @param integer $fromBC Boolean if this is a BC date
     * @param string $fromNotBefore Not before this date
     * @param string $fromNotAfter Not after this date
     * @param string $fromOriginal What we got from the CPF
     * @param string $toDate The to date
     * @param integer $toType Type of the date, fk to vocabulary.id
     * @param integer $toBC Boolean, true if BC
     * @param string $toNotBefore Not before this date
     * @param string $toNotAfter Not after this date
     * @param string $toOriginal What we got from the CPF
     * @param string $descriptiveNote Descriptive note
     * @param string $fk_table The name of the table to which this date and $fk_id apply.
     * @param integer $fk_id The id of the record to which this date applies.
     *
     * @return integer date_range record id, in case some other code is interested in what record id was
     * inserted.
     *
     */
Insert date
SNACDate.php has fromDateOriginal and toDateOriginal, but the CPF lacks date components, and the
database "original" is only the single original string.

@param string[] $vhInfo associative list with keys: version, ic_id
@param integer $id Record id. If null a new one will be minted.

@return integer date_range record id, in case some other code is interested in what record id was
inserted.
Insert date SNACDate . php has fromDateOriginal and toDateOriginal but the CPF lacks date components and the database " original " is only the single original string . @param string [] $vhInfo associative list with keys : version ic_id @param integer $id Record id . If null a new one will be minted . @return integer date_range record id in case some other code is interested in what record id was inserted .
public function insertDate($vhInfo,
                               $id,
                               $isRange,
                               $fromDate,
                               $fromType, 
                               $fromBC,
                               $fromNotBefore,
                               $fromNotAfter,
                               $fromOriginal,
                               $toDate,
                               $toType, 
                               $toBC,
                               $toNotBefore,
                               $toNotAfter,
                               $toOriginal,
                               $descriptiveNote,
                               $fk_table,
                               $fk_id)
    {
        if (! $id)
            {
                $id = $this->selectID();
            }
        $qq = 'insert_date';
        $this->sdb->prepare($qq,
                            'insert into date_range
                            (version, ic_id, id, is_range,
                            from_date, from_type, from_bc, from_not_before, from_not_after, from_original,
                            to_date, to_type, to_bc, to_not_before, to_not_after, to_original, descriptive_note, fk_table, fk_id)
                            values
                            ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19)');
        $result = $this->sdb->execute($qq,
                                      array($vhInfo['version'],
                                            $vhInfo['ic_id'],
                                            $id,
                                            $isRange,
                                            $fromDate,
                                            $fromType,
                                            $fromBC,
                                            $fromNotBefore,
                                            $fromNotAfter,
                                            $fromOriginal,
                                            $toDate,
                                            $toType,
                                            $toBC,
                                            $toNotBefore,
                                            $toNotAfter,
                                            $toOriginal,
                                            $descriptiveNote,
                                            $fk_table,
                                            $fk_id));
        $row = $this->sdb->fetchrow($result);
        $this->sdb->deallocate($qq);
        return $id;
    }
public function insertDate ( $ vhInfo , $ id , $ isRange , $ fromDate , $ fromType , $ fromBC , $ fromNotBefore , $ fromNotAfter , $ fromOriginal , $ toDate , $ toType , $ toBC , $ toNotBefore , $ toNotAfter , $ toOriginal , $ descriptiveNote , $ fk_table , $ fk_id ) { if ( ! $ id ) { $ id = $ this -> selectID ( ) ; } $ qq = 'insert_date' ; $ this -> sdb -> prepare ( $ qq , 'insert into date_range
                            (version, ic_id, id, is_range,
                            from_date, from_type, from_bc, from_not_before, from_not_after, from_original,
                            to_date, to_type, to_bc, to_not_before, to_not_after, to_original, descriptive_note, fk_table, fk_id)
                            values
                            ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19)' ) ; $ result = $ this -> sdb -> execute ( $ qq , array ( $ vhInfo [ 'version' ] , $ vhInfo [ 'ic_id' ] , $ id , $ isRange , $ fromDate , $ fromType , $ fromBC , $ fromNotBefore , $ fromNotAfter , $ fromOriginal , $ toDate , $ toType , $ toBC , $ toNotBefore , $ toNotAfter , $ toOriginal , $ descriptiveNote , $ fk_table , $ fk_id ) ) ; $ row = $ this -> sdb -> fetchrow ( $ result ) ; $ this -> sdb -> deallocate ( $ qq ) ; return $ id ; }
Insert date
 SNACDate.php has fromDateOriginal and toDateOriginal, but the CPF lacks date components, and the
 database "original" is only the single original string.
Insert date SNACDate . php has fromDateOriginal and toDateOriginal but the CPF lacks date components and the database " original " is only the single original string .
// fk to vocabulary // fk to vocabulary