Overview

Namespaces

  • Composer
    • Autoload
  • Geekwright
    • RegDom
  • League
    • OAuth2
      • Client
        • Provider
  • None
  • Xmf
    • Database
    • Jwt
    • Key
    • Module
      • Helper

Classes

  • Migrate
  • TableLoad
  • Tables
  • Overview
  • Namespace
  • Class
  • Tree

Class TableLoad

Xmf\Database\TableLoad

load a database table

Namespace: Xmf\Database
Package: Xmf
Category: Xmf\Database\TableLoad
Copyright: 2013-2016 XOOPS Project (http://xoops.org)
License: GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
Author: Richard Griffith richard@geekwright.com
Link: http://xoops.org
Located at lass/libraries/vendor/xoops/xmf/src/Xmf/Database/TableLoad.php
Methods summary
public static integer
# loadTableFromArray( string $table, array $data )

loadTableFromArray

loadTableFromArray

Parameters

$table
name of table to load without prefix
$data

array of rows to insert Each element of the outer array represents a single table row. Each row is an associative array in 'column' => 'value' format.

Returns

integer
number of rows inserted
public static integer
# loadTableFromYamlFile( string $table, string $yamlFile )

loadTableFromYamlFile

loadTableFromYamlFile

Parameters

$table
name of table to load without prefix
$yamlFile
name of file containing data dump in YAML format

Returns

integer
number of rows inserted
public static integer
# truncateTable( string $table )

truncateTable - empty a database table

truncateTable - empty a database table

Parameters

$table
name of table to truncate

Returns

integer
number of affected rows
public static integer
# countRows( string $table, CriteriaElement $criteria = null )

countRows - get count of rows in a table

countRows - get count of rows in a table

Parameters

$table
name of table to count
$criteria
optional criteria

Returns

integer
number of rows
public static array
# extractRows( string $table, CriteriaElement $criteria = null, string[] $skipColumns = array() )

extractRows - get rows, all or a subset, from a table as an array

extractRows - get rows, all or a subset, from a table as an array

Parameters

$table
name of table to count
$criteria
optional criteria
$skipColumns
do not include columns in this list

Returns

array
of table rows
public static boolean
# saveTableToYamlFile( string $table, string $yamlFile, CriteriaElement $criteria = null, string[] $skipColumns = array() )

Save table data to a YAML file

Save table data to a YAML file

Parameters

$table
name of table to load without prefix
$yamlFile
name of file containing data dump in YAML format
$criteria
optional criteria
$skipColumns
do not include columns in this list

Returns

boolean
true on success, false on error
API documentation generated by ApiGen