Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
SqlExport.php
Go to the documentation of this file.
1<?php
2
3namespace Ubiquity\db\export;
4
6
15class SqlExport extends DataExport {
16
17 public function __construct($batchSize=5) {
18 parent::__construct($batchSize);
19 }
20
21 public function exports($tableName, $fields, $condition="") {
22 $datas=DAO::$db->prepareAndExecute($tableName, $condition, $fields, null,false);
23 return $this->generateInsert($tableName, $fields, $datas);
24 }
25
26 protected function batchOneRow($row, $fields) {
27 $result=[ ];
28 foreach ( $fields as $field ) {
29 $result[]="'" . $row[$field] . "'";
30 }
31 return \implode(",", $result);
32 }
33}
generateInsert($table, $fields, $datas)
exports($tableName, $fields, $condition="")
Definition SqlExport.php:21
Gateway class between database and object model.
Definition DAO.php:33