Postgres::setSearchPath PHP Method

setSearchPath() public method

Sets the current schema search path
public setSearchPath ( $paths ) : -2
$paths An array of schemas in required search order
return -2
    function setSearchPath($paths)
    {
        if (!is_array($paths)) {
            return -1;
        } elseif (sizeof($paths) == 0) {
            return -2;
        } elseif (sizeof($paths) == 1 && $paths[0] == '') {
            // Need to handle empty paths in some cases
            $paths[0] = 'pg_catalog';
        }
        // Loop over all the paths to check that none are empty
        $temp = array();
        foreach ($paths as $schema) {
            if ($schema != '') {
                $temp[] = $schema;
            }
        }
        $this->fieldArrayClean($temp);
        $sql = 'SET SEARCH_PATH TO "' . implode('","', $temp) . '"';
        return $this->execute($sql);
    }
Postgres