Ubiquity
2.5.2
php rapid development framework
Loading...
Searching...
No Matches
SqlExport.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Ubiquity\db\export
;
4
5
use
Ubiquity\orm\DAO
;
6
15
class
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
}
Ubiquity\db\export\DataExport
Definition
DataExport.php:15
Ubiquity\db\export\DataExport\$batchSize
$batchSize
Definition
DataExport.php:16
Ubiquity\db\export\DataExport\generateInsert
generateInsert($table, $fields, $datas)
Definition
DataExport.php:22
Ubiquity\db\export\SqlExport
Definition
SqlExport.php:15
Ubiquity\db\export\SqlExport\__construct
__construct($batchSize=5)
Definition
SqlExport.php:17
Ubiquity\db\export\SqlExport\exports
exports($tableName, $fields, $condition="")
Definition
SqlExport.php:21
Ubiquity\db\export\SqlExport\batchOneRow
batchOneRow($row, $fields)
Definition
SqlExport.php:26
Ubiquity\orm\DAO
Gateway class between database and object model.
Definition
DAO.php:33
Ubiquity\db\export
Definition
DataExport.php:3
C:
Users
myadd
Documents
GitHub
ubiquity-doc-api
vendor
phpmv
ubiquity-dev
src
Ubiquity
db
export
SqlExport.php
Generated on Sun Dec 10 2023 15:04:07 for
Ubiquity
by
doxygen
1.9.8