Overview

Namespaces

  • Himedia
    • PDOTools
      • Mocks

Classes

  • DbTestCase
  • Tools
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo

Class Tools

Some useful functions.

Copyright (c) 2014 HiMedia Licensed under the GNU Lesser General Public License v3 (LGPL version 3).

Namespace: Himedia\PDOTools
Package: Himedia\PDOTools
Copyright: 2014 HiMedia
License: http://www.gnu.org/licenses/lgpl.html
Located at Himedia/PDOTools/Tools.php
Methods summary
public static string
# assocArrayToHstore( array $aData )

Converts associative array to PostgreSQL hstore syntax.

Converts associative array to PostgreSQL hstore syntax.

Parameters

$aData
associative array

Returns

string
hstore conversion of specified array

See

http://www.postgresql.org/docs/9.0/static/hstore.html
public static string
# exportToCSV( array $aRows, string $sCsvPath, string $sDelimiter = ',', string $sEnclosure = '"' )

Export associative result set to CSV file or string.

Export associative result set to CSV file or string.

Parameters

$aRows
Associative fetch all.
$sCsvPath
Path to export CSV. Set to '' to export into returning string.
$sDelimiter
Field delimiter
$sEnclosure
Field enclosure

Returns

string
If no $sCsvPath, then CSV formatted string without the trailing newline, else empty string.
public static string
# normalizeQuery( mixed $sRawQuery )

Normalize specified query removing comments and multiple white spaces.

Normalize specified query removing comments and multiple white spaces.

Parameters

$sRawQuery

Returns

string
query normalized by removing comments and multiple white spaces.

See

http://stackoverflow.com/a/13823184
PDOTools API documentation generated by ApiGen 2.8.0