src/snac/server/database/DatabaseConnector.php
/**
     * Convert Postgres boolean to php
     *
     * pg_execute() doesn't know to convert boolean to 't' and 'f' from Postgres to php true and false. We do
     * it ourselves.
     *
     * This is for Postgres boolean types which may only have values 't' or 'f'. Any other value is an error.
     *
     * @throws \snac\exceptions\SNACDatabaseException

     * @param string $arg A php boolean of whatever type as long as it will test true or false.
     *
     * @return boolean Return php true or false.
     */


This is for Postgres boolean types which may only have values 't' or 'f'. Any other value is an error.



@param string $arg A php boolean of whatever type as long as it will test true or false.

@return boolean Return php true or false.
This is for Postgres boolean types which may only have values ' t ' or ' f ' . Any other value is an error . @param string $arg A php boolean of whatever type as long as it will test true or false . @return boolean Return php true or false .
public static function pgToBool($arg)
    {
        if ($arg == 't')
        {
            return true;
        }
        elseif ($arg == 'f')
        {
            return false;
        }
        throw new \snac\exceptions\SNACDatabaseException("DatabaseConnector.php pgToBool() Error: arg: $arg cannot convert to true or false");
    }
public static function pgToBool ( $ arg ) { if ( $ arg == 't' ) { return true ; } elseif ( $ arg == 'f' ) { return false ; } throw new \ snac \ exceptions \ SNACDatabaseException ( " DatabaseConnector.php pgToBool() Error: arg:  $ arg  cannot convert to true or false " ) ; }
Convert Postgres boolean to php
 pg_execute() doesn't know to convert boolean to 't' and 'f' from Postgres to php true and false.
Convert Postgres boolean to php pg_execute () doesn ' t know to convert boolean to ' t ' and ' f ' from Postgres to php true and false .
// If we get down here, something is very wrong. Seems like this should be fatal. // printf("\nDatabaseConnector.php Error: arg: $arg cannot convert to true or false\n");