Skip to content

Commit

Permalink
CSVテスト
Browse files Browse the repository at this point in the history
  • Loading branch information
oywc410 committed Jan 14, 2020
1 parent 54dab5f commit 9052e3c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions src/Eccube/Controller/Admin/Customer/CustomerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,18 +298,21 @@ public function export(Request $request)
// データ行の出力.
$this->csvExportService->setExportQueryBuilder($qb);
$this->csvExportService->exportData(function ($entity, $csvService) use ($request) {

$Csvs = $csvService->getCsvs();

/** @var $Customer \Eccube\Entity\Customer */
/** @var \Eccube\Entity\Customer $Customer */
$Customer = $entity;

$ExportCsvRow = new \Eccube\Entity\ExportCsvRow();

// CSV出力項目と合致するデータを取得.
foreach ($Csvs as $Csv) {

// 会員データを検索.
$ExportCsvRow->setData($csvService->getData($Csv, $Customer));

/*
$event = new EventArgs(
[
'csvService' => $csvService,
Expand All @@ -320,13 +323,16 @@ public function export(Request $request)
$request
);
$this->eventDispatcher->dispatch(EccubeEvents::ADMIN_CUSTOMER_CSV_EXPORT, $event);
*/

$ExportCsvRow->pushData();
}

//$row[] = number_format(memory_get_usage(true));
// 出力.
$csvService->fputcsv($ExportCsvRow->getRow());

echo '利用メモリ:' . memory_get_usage() . "\n";
});
});

Expand All @@ -337,7 +343,7 @@ public function export(Request $request)

$response->send();

log_info('会員CSVファイル名', [$filename]);
//log_info('会員CSVファイル名', [$filename]);

return $response;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Eccube/Util/EntityUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class EntityUtil
*/
public static function isEmpty($entity)
{
@trigger_error('The '.__METHOD__.' method is deprecated.', E_USER_DEPRECATED);
//@trigger_error('The '.__METHOD__.' method is deprecated.', E_USER_DEPRECATED);
if ($entity instanceof Proxy) {
try {
$entity->__load();
Expand Down Expand Up @@ -65,7 +65,7 @@ public static function isEmpty($entity)
*/
public static function isNotEmpty($entity)
{
@trigger_error('The '.__METHOD__.' method is deprecated.', E_USER_DEPRECATED);
//@trigger_error('The '.__METHOD__.' method is deprecated.', E_USER_DEPRECATED);

return !self::isEmpty($entity);
}
Expand Down

0 comments on commit 9052e3c

Please sign in to comment.