src/snac/server/database/SQL.php
/**
     * Insert a contributor record
     *
     * Related to name where contributor.name_id=name.id. This is a one-sided fk relationship also used for
     * date and language.
     *
     * Old: Contributor has issues. See comments in schema.sql. This will work for now.  Need to fix insert
     * name_contributor to keep the existing id values. Also, do not update if not changed. Implies a
     * name_contributor object with a $operation like everything else.
     *
     * @param string[] $vhInfo associative list with keys: version, ic_id
     *
     * @param integer $id Record id if this contributor. If null one will be minted. The id (existing or new) is always returned.
     *
     * @param integer $nameID Record id of related name
     *
     * @param string $name Name of the contributor
     *
     * @param integer $typeID Vocabulary fk id of the type of this contributor.
     * @param integer $ruleID Vocabulary fk id of the rule of this contributor.
     *
     * @return integer $id Return the existing id, or the newly minted id.
     */


Contributor has issues.

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

@param integer $id Record id if this contributor. If null one will be minted. The id (existing or new) is always returned.

@param integer $nameID Record id of related name

@param string $name Name of the contributor

@param integer $typeID Vocabulary fk id of the type of this contributor.
@param integer $ruleID Vocabulary fk id of the rule of this contributor.

@return integer $id Return the existing id, or the newly minted id.
Contributor has issues . @param string [] $vhInfo associative list with keys : version ic_id @param integer $id Record id if this contributor . If null one will be minted . The id ( existing or new ) is always returned . @param integer $nameID Record id of related name @param string $name Name of the contributor @param integer $typeID Vocabulary fk id of the type of this contributor . @param integer $ruleID Vocabulary fk id of the rule of this contributor . @return integer $id Return the existing id or the newly minted id .
public function insertContributor($vhInfo, $id, $nameID, $name, $typeID, $ruleID)
    {
        if ($nameID == null)
        {
            printf("SQL.php Fatal: \$nameID must not be null\n");
            exit();
        }
        if (! $id)
        {
            $id = $this->selectID();
        }
        $qq_2 = 'insert_contributor';
        $this->sdb->prepare($qq_2,
                            'insert into name_contributor
                            (version, ic_id, id, name_id, short_name, name_type, rule)
                            values
                            ($1, $2, $3, $4, $5, $6, $7)');
        $this->sdb->execute($qq_2,
                            array($vhInfo['version'],
                                  $vhInfo['ic_id'],
                                  $id,
                                  $nameID,
                                  $name,
                                  $typeID,
                                  $ruleID));
        $this->sdb->deallocate($qq_2);
        return $id;
    }
public function insertContributor ( $ vhInfo , $ id , $ nameID , $ name , $ typeID , $ ruleID ) { if ( $ nameID == null ) { printf ( " SQL.php Fatal:  \$ nameID must not be null \n " ) ; exit ( ) ; } if ( ! $ id ) { $ id = $ this -> selectID ( ) ; } $ qq_2 = 'insert_contributor' ; $ this -> sdb -> prepare ( $ qq_2 , 'insert into name_contributor
                            (version, ic_id, id, name_id, short_name, name_type, rule)
                            values
                            ($1, $2, $3, $4, $5, $6, $7)' ) ; $ this -> sdb -> execute ( $ qq_2 , array ( $ vhInfo [ 'version' ] , $ vhInfo [ 'ic_id' ] , $ id , $ nameID , $ name , $ typeID , $ ruleID ) ) ; $ this -> sdb -> deallocate ( $ qq_2 ) ; return $ id ; }
Insert a contributor record
 Related to name where contributor.name_id=name.id.
Insert a contributor record Related to name where contributor . name_id = name . id .
/*
             * This did happen, but once we have good tests it should never happen again. Perhaps better to
             * add a "not null" to the db schema.
             */