@@ -44,9 +44,9 @@ |
||
44 | 44 | */ |
45 | 45 | public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) |
46 | 46 | { |
47 | - return 'ROW_NUMBER() OVER(' . trim($sqlWalker->walkOrderByClause( |
|
47 | + return 'ROW_NUMBER() OVER('.trim($sqlWalker->walkOrderByClause( |
|
48 | 48 | $this->orderByClause |
49 | - )) . ')'; |
|
49 | + )).')'; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
@@ -209,8 +209,8 @@ discard block |
||
209 | 209 | $sqlIdentifier = $this->getSQLIdentifier($AST); |
210 | 210 | |
211 | 211 | if ($hasOrderBy) { |
212 | - $orderGroupBy = ' GROUP BY ' . implode(', ', $sqlIdentifier); |
|
213 | - $sqlIdentifier[] = 'MIN(' . $this->walkResultVariable('dctrn_rownum') . ') AS dctrn_minrownum'; |
|
212 | + $orderGroupBy = ' GROUP BY '.implode(', ', $sqlIdentifier); |
|
213 | + $sqlIdentifier[] = 'MIN('.$this->walkResultVariable('dctrn_rownum').') AS dctrn_minrownum'; |
|
214 | 214 | } |
215 | 215 | |
216 | 216 | // Build the counter query |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | ); |
222 | 222 | |
223 | 223 | if ($hasOrderBy) { |
224 | - $sql .= $orderGroupBy . $outerOrderBy; |
|
224 | + $sql .= $orderGroupBy.$outerOrderBy; |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | // Apply the limit and offset. |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | { |
369 | 369 | // If the sql statement has an order by clause, we need to wrap it in a new select distinct |
370 | 370 | // statement |
371 | - if (! $orderByClause instanceof OrderByClause) { |
|
371 | + if (!$orderByClause instanceof OrderByClause) { |
|
372 | 372 | return $sql; |
373 | 373 | } |
374 | 374 | |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | = array(); |
405 | 405 | |
406 | 406 | // Generate DQL alias -> SQL table alias mapping |
407 | - foreach(array_keys($this->rsm->aliasMap) as $dqlAlias) { |
|
407 | + foreach (array_keys($this->rsm->aliasMap) as $dqlAlias) { |
|
408 | 408 | $dqlAliasToClassMap[$dqlAlias] = $class = $this->queryComponents[$dqlAlias]['metadata']; |
409 | 409 | $dqlAliasToSqlTableAliasMap[$dqlAlias] = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
410 | 410 | } |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | $fieldSearchPattern = '/(?<![a-z0-9_])%s\.%s(?![a-z0-9_])/i'; |
414 | 414 | |
415 | 415 | // Generate search patterns for each field's path expression in the order by clause |
416 | - foreach($this->rsm->fieldMappings as $fieldAlias => $fieldName) { |
|
416 | + foreach ($this->rsm->fieldMappings as $fieldAlias => $fieldName) { |
|
417 | 417 | $dqlAliasForFieldAlias = $this->rsm->columnOwnerMap[$fieldAlias]; |
418 | 418 | $class = $dqlAliasToClassMap[$dqlAliasForFieldAlias]; |
419 | 419 | |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | $replacements[] = $fieldAlias; |
450 | 450 | } |
451 | 451 | |
452 | - foreach($orderByClause->orderByItems as $orderByItem) { |
|
452 | + foreach ($orderByClause->orderByItems as $orderByItem) { |
|
453 | 453 | // Walk order by item to get string representation of it |
454 | 454 | $orderByItemString = $this->walkOrderByItem($orderByItem); |
455 | 455 |
@@ -91,7 +91,7 @@ |
||
91 | 91 | } |
92 | 92 | } |
93 | 93 | |
94 | - $recursive = function ($config, $space = ' ') use (&$recursive, $output) { |
|
94 | + $recursive = function($config, $space = ' ') use (&$recursive, $output) { |
|
95 | 95 | foreach ($config as $key => $item) { |
96 | 96 | if (is_array($item)) { |
97 | 97 | $space = ' '; |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | $em->getConfiguration()->setSQLLogger(null); |
236 | 236 | |
237 | 237 | $response = new StreamedResponse(); |
238 | - $response->setCallback(function () use ($app, $request) { |
|
238 | + $response->setCallback(function() use ($app, $request) { |
|
239 | 239 | |
240 | 240 | // CSV種別を元に初期化. |
241 | 241 | $app['eccube.service.csv.export']->initCsvType(CsvType::CSV_TYPE_CUSTOMER); |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | |
250 | 250 | // データ行の出力. |
251 | 251 | $app['eccube.service.csv.export']->setExportQueryBuilder($qb); |
252 | - $app['eccube.service.csv.export']->exportData(function ($entity, $csvService) use ($app, $request) { |
|
252 | + $app['eccube.service.csv.export']->exportData(function($entity, $csvService) use ($app, $request) { |
|
253 | 253 | |
254 | 254 | $Csvs = $csvService->getCsvs(); |
255 | 255 | |
@@ -284,9 +284,9 @@ discard block |
||
284 | 284 | }); |
285 | 285 | |
286 | 286 | $now = new \DateTime(); |
287 | - $filename = 'customer_' . $now->format('YmdHis') . '.csv'; |
|
287 | + $filename = 'customer_'.$now->format('YmdHis').'.csv'; |
|
288 | 288 | $response->headers->set('Content-Type', 'application/octet-stream'); |
289 | - $response->headers->set('Content-Disposition', 'attachment; filename=' . $filename); |
|
289 | + $response->headers->set('Content-Disposition', 'attachment; filename='.$filename); |
|
290 | 290 | |
291 | 291 | $response->send(); |
292 | 292 |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | $em->getConfiguration()->setSQLLogger(null); |
241 | 241 | |
242 | 242 | $response = new StreamedResponse(); |
243 | - $response->setCallback(function () use ($app, $request) { |
|
243 | + $response->setCallback(function() use ($app, $request) { |
|
244 | 244 | |
245 | 245 | // CSV種別を元に初期化. |
246 | 246 | $app['eccube.service.csv.export']->initCsvType(CsvType::CSV_TYPE_ORDER); |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | |
255 | 255 | // データ行の出力. |
256 | 256 | $app['eccube.service.csv.export']->setExportQueryBuilder($qb); |
257 | - $app['eccube.service.csv.export']->exportData(function ($entity, $csvService) use ($app, $request) { |
|
257 | + $app['eccube.service.csv.export']->exportData(function($entity, $csvService) use ($app, $request) { |
|
258 | 258 | |
259 | 259 | $Csvs = $csvService->getCsvs(); |
260 | 260 | |
@@ -295,9 +295,9 @@ discard block |
||
295 | 295 | }); |
296 | 296 | |
297 | 297 | $now = new \DateTime(); |
298 | - $filename = 'order_' . $now->format('YmdHis') . '.csv'; |
|
298 | + $filename = 'order_'.$now->format('YmdHis').'.csv'; |
|
299 | 299 | $response->headers->set('Content-Type', 'application/octet-stream'); |
300 | - $response->headers->set('Content-Disposition', 'attachment; filename=' . $filename); |
|
300 | + $response->headers->set('Content-Disposition', 'attachment; filename='.$filename); |
|
301 | 301 | $response->send(); |
302 | 302 | |
303 | 303 | log_info('受注CSV出力ファイル名', array($filename)); |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | $em->getConfiguration()->setSQLLogger(null); |
323 | 323 | |
324 | 324 | $response = new StreamedResponse(); |
325 | - $response->setCallback(function () use ($app, $request) { |
|
325 | + $response->setCallback(function() use ($app, $request) { |
|
326 | 326 | |
327 | 327 | // CSV種別を元に初期化. |
328 | 328 | $app['eccube.service.csv.export']->initCsvType(CsvType::CSV_TYPE_SHIPPING); |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | |
337 | 337 | // データ行の出力. |
338 | 338 | $app['eccube.service.csv.export']->setExportQueryBuilder($qb); |
339 | - $app['eccube.service.csv.export']->exportData(function ($entity, $csvService) use ($app, $request) { |
|
339 | + $app['eccube.service.csv.export']->exportData(function($entity, $csvService) use ($app, $request) { |
|
340 | 340 | |
341 | 341 | $Csvs = $csvService->getCsvs(); |
342 | 342 | |
@@ -386,9 +386,9 @@ discard block |
||
386 | 386 | }); |
387 | 387 | |
388 | 388 | $now = new \DateTime(); |
389 | - $filename = 'shipping_' . $now->format('YmdHis') . '.csv'; |
|
389 | + $filename = 'shipping_'.$now->format('YmdHis').'.csv'; |
|
390 | 390 | $response->headers->set('Content-Type', 'application/octet-stream'); |
391 | - $response->headers->set('Content-Disposition', 'attachment; filename=' . $filename); |
|
391 | + $response->headers->set('Content-Disposition', 'attachment; filename='.$filename); |
|
392 | 392 | $response->send(); |
393 | 393 | |
394 | 394 | log_info('配送CSV出力ファイル名', array($filename)); |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | $em->getConfiguration()->setSQLLogger(null); |
206 | 206 | |
207 | 207 | $response = new StreamedResponse(); |
208 | - $response->setCallback(function () use ($app, $request) { |
|
208 | + $response->setCallback(function() use ($app, $request) { |
|
209 | 209 | |
210 | 210 | // CSV種別を元に初期化. |
211 | 211 | $app['eccube.service.csv.export']->initCsvType(CsvType::CSV_TYPE_CATEGORY); |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | |
220 | 220 | // データ行の出力. |
221 | 221 | $app['eccube.service.csv.export']->setExportQueryBuilder($qb); |
222 | - $app['eccube.service.csv.export']->exportData(function ($entity, $csvService) use ($app, $request) { |
|
222 | + $app['eccube.service.csv.export']->exportData(function($entity, $csvService) use ($app, $request) { |
|
223 | 223 | |
224 | 224 | $Csvs = $csvService->getCsvs(); |
225 | 225 | |
@@ -252,9 +252,9 @@ discard block |
||
252 | 252 | }); |
253 | 253 | |
254 | 254 | $now = new \DateTime(); |
255 | - $filename = 'category_' . $now->format('YmdHis') . '.csv'; |
|
255 | + $filename = 'category_'.$now->format('YmdHis').'.csv'; |
|
256 | 256 | $response->headers->set('Content-Type', 'application/octet-stream'); |
257 | - $response->headers->set('Content-Disposition', 'attachment; filename=' . $filename); |
|
257 | + $response->headers->set('Content-Disposition', 'attachment; filename='.$filename); |
|
258 | 258 | $response->send(); |
259 | 259 | |
260 | 260 | log_info('カテゴリCSV出力ファイル名', array($filename)); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $this->output->writeln('------------------------------------------------------'); |
48 | 48 | $this->output->writeln('---Plugin Generator for Entity'); |
49 | 49 | $this->output->writeln('---[*] You need to create yaml file first.'); |
50 | - $this->output->writeln('---[*]You can exit from Console Application, by typing ' . self::STOP_PROCESS . ' instead of typing another word.'); |
|
50 | + $this->output->writeln('---[*]You can exit from Console Application, by typing '.self::STOP_PROCESS.' instead of typing another word.'); |
|
51 | 51 | $this->output->writeln('------------------------------------------------------'); |
52 | 52 | $this->output->writeln(''); |
53 | 53 | } |
@@ -62,11 +62,11 @@ discard block |
||
62 | 62 | $pluginCode = $this->paramList['pluginCode']['value']; |
63 | 63 | $yamlList = $this->paramList['entityList']['value']; |
64 | 64 | |
65 | - $codePath = $this->app['config']['root_dir'] . '/app/Plugin/' . $pluginCode; |
|
65 | + $codePath = $this->app['config']['root_dir'].'/app/Plugin/'.$pluginCode; |
|
66 | 66 | |
67 | 67 | $dirList = array('Entity', 'Repository', '/Resource/doctrine/migration'); |
68 | 68 | foreach ($dirList as $dirName) { |
69 | - $dirPath = $codePath . '/' . $dirName; |
|
69 | + $dirPath = $codePath.'/'.$dirName; |
|
70 | 70 | if (!is_dir($dirPath)) { |
71 | 71 | mkdir($dirPath); |
72 | 72 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $metadetas = array(); |
80 | 80 | |
81 | 81 | |
82 | - $YamlDriver = new YamlDriver(array($codePath . '/Resource/doctrine')); |
|
82 | + $YamlDriver = new YamlDriver(array($codePath.'/Resource/doctrine')); |
|
83 | 83 | foreach ($yamlList as $pathYaml => $fullClassName) { |
84 | 84 | |
85 | 85 | $MetadataInfo = new ClassMetadataInfo($fullClassName); |
@@ -95,9 +95,9 @@ discard block |
||
95 | 95 | $EntityGenerator->setGenerateStubMethods(true); |
96 | 96 | $EntityGenerator->setUpdateEntityIfExists(false); |
97 | 97 | |
98 | - $pathClass = $this->app['config']['root_dir'] . '/app/'; |
|
98 | + $pathClass = $this->app['config']['root_dir'].'/app/'; |
|
99 | 99 | $EntityGenerator->generate(array($MetadataInfo), $pathClass); |
100 | - $pathClass .= str_replace('\\', DIRECTORY_SEPARATOR, $MetadataInfo->name) . '.php'; |
|
100 | + $pathClass .= str_replace('\\', DIRECTORY_SEPARATOR, $MetadataInfo->name).'.php'; |
|
101 | 101 | if (is_file($pathClass)) { |
102 | 102 | $fsList['file'][$pathClass] = true; |
103 | 103 | } else { |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $migrationContent = $this->makeMigration($pluginCode, $metadetas); |
119 | 119 | $timeSt = date('YmdHis'); |
120 | 120 | $migrationContent = str_replace('[datetime]', $timeSt, $migrationContent); |
121 | - $migPath = $codePath . '/Resource/doctrine/migration/Version' . $timeSt . '.php'; |
|
121 | + $migPath = $codePath.'/Resource/doctrine/migration/Version'.$timeSt.'.php'; |
|
122 | 122 | |
123 | 123 | file_put_contents($migPath, $migrationContent); |
124 | 124 | if (is_file($migPath)) { |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $this->output->writeln(''); |
151 | 151 | $this->output->writeln(' this files and folders were created.'); |
152 | 152 | foreach ($dirFileOk as $path) { |
153 | - $this->output->writeln('<info> - ' . $path . '</info>'); |
|
153 | + $this->output->writeln('<info> - '.$path.'</info>'); |
|
154 | 154 | } |
155 | 155 | } |
156 | 156 | } |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | |
202 | 202 | if ($this->entityList === null) { |
203 | 203 | $this->entityList = array(); |
204 | - $directory = $this->app['config']['root_dir'] . '/app/Plugin/' . $this->paramList['pluginCode']['value'] . '/Resource/doctrine/'; |
|
204 | + $directory = $this->app['config']['root_dir'].'/app/Plugin/'.$this->paramList['pluginCode']['value'].'/Resource/doctrine/'; |
|
205 | 205 | if (!is_dir($directory)) { |
206 | 206 | return $this->entityList; |
207 | 207 | } |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | private function getPluginList() |
223 | 223 | { |
224 | 224 | $ret = array(); |
225 | - $pluginDir = $this->app['config']['root_dir'] . '/app/Plugin'; |
|
225 | + $pluginDir = $this->app['config']['root_dir'].'/app/Plugin'; |
|
226 | 226 | $iterator = new \DirectoryIterator($pluginDir); |
227 | 227 | foreach ($iterator as $fileInfo) { |
228 | 228 | if ($fileInfo->isDot()) { |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | |
238 | 238 | private function toCamelCase($name) |
239 | 239 | { |
240 | - return lcfirst(implode('', array_map(function ($name) { |
|
240 | + return lcfirst(implode('', array_map(function($name) { |
|
241 | 241 | return ucfirst($name); |
242 | 242 | }, explode('_', $name)))); |
243 | 243 | } |
@@ -249,31 +249,31 @@ discard block |
||
249 | 249 | $line = array(); |
250 | 250 | $line[] = '<?php'; |
251 | 251 | $line[] = '/*'; |
252 | - $line[] = ' * This file is part of ' . $pluginCode; |
|
252 | + $line[] = ' * This file is part of '.$pluginCode; |
|
253 | 253 | $line[] = ' *'; |
254 | 254 | $line[] = ' *'; |
255 | 255 | $line[] = ' * For the full copyright and license information, please view the LICENSE'; |
256 | 256 | $line[] = ' * file that was distributed with this source code.'; |
257 | 257 | $line[] = ' */'; |
258 | 258 | $line[] = ''; |
259 | - $line[] = 'namespace Plugin\\' . $pluginCode . '\Repository;'; |
|
259 | + $line[] = 'namespace Plugin\\'.$pluginCode.'\Repository;'; |
|
260 | 260 | $line[] = ''; |
261 | 261 | $line[] = 'use Doctrine\ORM\EntityRepository;'; |
262 | 262 | $line[] = ''; |
263 | 263 | $line[] = '/**'; |
264 | - $line[] = ' * ' . $nameFormated; |
|
264 | + $line[] = ' * '.$nameFormated; |
|
265 | 265 | $line[] = ' *'; |
266 | 266 | $line[] = ' * This class was generated by the Doctrine ORM. Add your own custom'; |
267 | 267 | $line[] = ' * repository methods below.'; |
268 | 268 | $line[] = ' */'; |
269 | - $line[] = 'class ' . $nameFormated . 'Repository extends EntityRepository'; |
|
269 | + $line[] = 'class '.$nameFormated.'Repository extends EntityRepository'; |
|
270 | 270 | $line[] = '{'; |
271 | 271 | $line[] = ''; |
272 | 272 | $line[] = '}'; |
273 | 273 | $line[] = ''; |
274 | 274 | |
275 | 275 | $cont = join(PHP_EOL, $line); |
276 | - $filename = $this->app['config']['root_dir'] . '/app/Plugin/' . $pluginCode . '/Repository/' . $nameFormated . 'Repository.php'; |
|
276 | + $filename = $this->app['config']['root_dir'].'/app/Plugin/'.$pluginCode.'/Repository/'.$nameFormated.'Repository.php'; |
|
277 | 277 | file_put_contents($filename, $cont); |
278 | 278 | return $filename; |
279 | 279 | } |
@@ -281,20 +281,20 @@ discard block |
||
281 | 281 | private function makeMigration($pluginCode, $metadetas) |
282 | 282 | { |
283 | 283 | if ($this->paramList['supportFlag']['value']) { |
284 | - $migrationFileCont = file_get_contents($this->app['config']['root_dir'] . '/src/Eccube/Command/PluginCommand/Resource/MigrationVersionSupport.php'); |
|
284 | + $migrationFileCont = file_get_contents($this->app['config']['root_dir'].'/src/Eccube/Command/PluginCommand/Resource/MigrationVersionSupport.php'); |
|
285 | 285 | } else { |
286 | - $migrationFileCont = file_get_contents($this->app['config']['root_dir'] . '/src/Eccube/Command/PluginCommand/Resource/MigrationVersion.php'); |
|
286 | + $migrationFileCont = file_get_contents($this->app['config']['root_dir'].'/src/Eccube/Command/PluginCommand/Resource/MigrationVersion.php'); |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | $entityList = $this->createEntityList($pluginCode, $metadetas); |
290 | 290 | |
291 | - $entityListStr = join(',' . PHP_EOL, $entityList); |
|
291 | + $entityListStr = join(','.PHP_EOL, $entityList); |
|
292 | 292 | $migrationFileCont = str_replace('[entityList]', $entityListStr, $migrationFileCont); |
293 | 293 | if ($this->paramList['supportFlag']['value']) { |
294 | 294 | $createParts = $this->makeCreateParts($metadetas); |
295 | 295 | $tableNameArr = array(); |
296 | 296 | foreach ($createParts as $tableName => $tableArr) { |
297 | - $tableNameArr[] = ' $this->createTable' . $tableName . '($schema);'; |
|
297 | + $tableNameArr[] = ' $this->createTable'.$tableName.'($schema);'; |
|
298 | 298 | } |
299 | 299 | $tableNameStr = join(PHP_EOL, $tableNameArr); |
300 | 300 | $migrationFileCont = str_replace('[createTable]', $tableNameStr, $migrationFileCont); |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | { |
318 | 318 | $ret = array(); |
319 | 319 | foreach ($migrations as $metadata) { |
320 | - $ret[] = " '" . 'Plugin\\' . $pluginCode . '\Entity\\' . ucfirst($this->getShortClassName($metadata->table['name'])) . "'"; |
|
320 | + $ret[] = " '".'Plugin\\'.$pluginCode.'\Entity\\'.ucfirst($this->getShortClassName($metadata->table['name']))."'"; |
|
321 | 321 | } |
322 | 322 | return $ret; |
323 | 323 | } |
@@ -335,14 +335,14 @@ discard block |
||
335 | 335 | $nameFormated = $this->getShortClassName($metadata->table['name']); |
336 | 336 | $tmp = array(); |
337 | 337 | $tmp[] = ''; |
338 | - $tmp[] = ' public function createTable' . ucfirst($nameFormated) . '(Schema $schema)'; |
|
338 | + $tmp[] = ' public function createTable'.ucfirst($nameFormated).'(Schema $schema)'; |
|
339 | 339 | $tmp[] = ' {'; |
340 | - $tmp[] = ' $table = $schema->createTable(\'' . $metadata->table['name'] . '\');'; |
|
340 | + $tmp[] = ' $table = $schema->createTable(\''.$metadata->table['name'].'\');'; |
|
341 | 341 | $columns = $metadata->fieldMappings; |
342 | 342 | foreach ($columns as $column) { |
343 | 343 | |
344 | 344 | $typeName = $column['type']; |
345 | - $tmp[] = ' $table->addColumn(\'' . $column['columnName'] . '\', \'' . $typeName . '\', array('; |
|
345 | + $tmp[] = ' $table->addColumn(\''.$column['columnName'].'\', \''.$typeName.'\', array('; |
|
346 | 346 | $param = array(); |
347 | 347 | if (isset($column['nullable']) && $column['nullable']) { |
348 | 348 | $param['notnull'] = 'true'; |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | } |
352 | 352 | |
353 | 353 | foreach ($param as $parKey => $parVal) { |
354 | - $tmp[] = ' \'' . $parKey . '\' => ' . $parVal . ','; |
|
354 | + $tmp[] = ' \''.$parKey.'\' => '.$parVal.','; |
|
355 | 355 | } |
356 | 356 | $tmp[] = ' ));'; |
357 | 357 | } |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | { |
370 | 370 | $ret = array(); |
371 | 371 | foreach ($metadetas as $metadata) { |
372 | - $ret[] = ' $schema->dropTable(\'' . $metadata->table['name'] . '\');'; |
|
372 | + $ret[] = ' $schema->dropTable(\''.$metadata->table['name'].'\');'; |
|
373 | 373 | } |
374 | 374 | |
375 | 375 | return $ret; |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $this->output->writeln('------------------------------------------------------'); |
44 | 44 | $this->output->writeln('---Plugin Generator for Entity'); |
45 | 45 | $this->output->writeln('---[*] You need to create table schema first.'); |
46 | - $this->output->writeln('---[*]You can exit from Console Application, by typing ' . self::STOP_PROCESS . ' instead of typing another word.'); |
|
46 | + $this->output->writeln('---[*]You can exit from Console Application, by typing '.self::STOP_PROCESS.' instead of typing another word.'); |
|
47 | 47 | $this->output->writeln('------------------------------------------------------'); |
48 | 48 | $this->output->writeln(''); |
49 | 49 | } |
@@ -57,11 +57,11 @@ discard block |
||
57 | 57 | |
58 | 58 | $pluginCode = $this->paramList['pluginCode']['value']; |
59 | 59 | $tableList = $this->paramList['tableList']['value']; |
60 | - $codePath = $this->app['config']['root_dir'] . '/app/Plugin/' . $pluginCode; |
|
60 | + $codePath = $this->app['config']['root_dir'].'/app/Plugin/'.$pluginCode; |
|
61 | 61 | |
62 | 62 | $dirList = array('Entity', 'Repository', 'Resource', 'Resource/doctrine', '/Resource/doctrine/migration'); |
63 | 63 | foreach ($dirList as $dirName) { |
64 | - $dirPath = $codePath . '/' . $dirName; |
|
64 | + $dirPath = $codePath.'/'.$dirName; |
|
65 | 65 | if (!is_dir($dirPath)) { |
66 | 66 | mkdir($dirPath); |
67 | 67 | } |
@@ -86,13 +86,13 @@ discard block |
||
86 | 86 | $migrationContent = $this->makeMigration($pluginCode, $migration); |
87 | 87 | $timeSt = date('YmdHis'); |
88 | 88 | $migrationContent = str_replace('[datetime]', $timeSt, $migrationContent); |
89 | - $path = '/Resource/doctrine/migration/Version' . $timeSt . '.php'; |
|
89 | + $path = '/Resource/doctrine/migration/Version'.$timeSt.'.php'; |
|
90 | 90 | $entityInfoList[] = array($path => $migrationContent); |
91 | 91 | } |
92 | 92 | |
93 | 93 | foreach ($entityInfoList as $entityInfo) { |
94 | 94 | foreach ($entityInfo as $path => $body) { |
95 | - $fullPath = $this->app['config']['root_dir'] . '/app/Plugin/' . $pluginCode . $path; |
|
95 | + $fullPath = $this->app['config']['root_dir'].'/app/Plugin/'.$pluginCode.$path; |
|
96 | 96 | file_put_contents($fullPath, $body); |
97 | 97 | if (is_file($fullPath)) { |
98 | 98 | $fsList['file'][$fullPath] = true; |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $this->output->writeln(''); |
124 | 124 | $this->output->writeln(' this files and folders were created.'); |
125 | 125 | foreach ($dirFileOk as $path) { |
126 | - $this->output->writeln('<info> - ' . $path . '</info>'); |
|
126 | + $this->output->writeln('<info> - '.$path.'</info>'); |
|
127 | 127 | } |
128 | 128 | } |
129 | 129 | } |
@@ -134,11 +134,11 @@ discard block |
||
134 | 134 | $nameFormated = ucfirst($this->toCamelCase($tableName)); |
135 | 135 | |
136 | 136 | $ret = array(); |
137 | - $ret['/Entity/' . $nameFormated . '.php'] = $this->getSrc($pluginCode, $TableInfo); |
|
137 | + $ret['/Entity/'.$nameFormated.'.php'] = $this->getSrc($pluginCode, $TableInfo); |
|
138 | 138 | |
139 | - $ret['/Resource/doctrine/Plugin.' . $pluginCode . '.Entity.' . $nameFormated . '.dcm.yml'] = $this->getConfig($pluginCode, $TableInfo); |
|
139 | + $ret['/Resource/doctrine/Plugin.'.$pluginCode.'.Entity.'.$nameFormated.'.dcm.yml'] = $this->getConfig($pluginCode, $TableInfo); |
|
140 | 140 | |
141 | - $ret['/Repository/' . $nameFormated . 'Repository.php'] = $this->getRepo($pluginCode, $TableInfo); |
|
141 | + $ret['/Repository/'.$nameFormated.'Repository.php'] = $this->getRepo($pluginCode, $TableInfo); |
|
142 | 142 | |
143 | 143 | return $ret; |
144 | 144 | } |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | private function getPluginList() |
202 | 202 | { |
203 | 203 | $ret = array(); |
204 | - $pluginDir = $this->app['config']['root_dir'] . '/app/Plugin'; |
|
204 | + $pluginDir = $this->app['config']['root_dir'].'/app/Plugin'; |
|
205 | 205 | $iterator = new \DirectoryIterator($pluginDir); |
206 | 206 | foreach ($iterator as $fileInfo) { |
207 | 207 | if ($fileInfo->isDot()) { |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | |
217 | 217 | private function toCamelCase($name) |
218 | 218 | { |
219 | - return lcfirst(implode('', array_map(function ($name) { |
|
219 | + return lcfirst(implode('', array_map(function($name) { |
|
220 | 220 | return ucfirst($name); |
221 | 221 | }, explode('_', $name)))); |
222 | 222 | } |
@@ -259,43 +259,43 @@ discard block |
||
259 | 259 | $varName = 'string'; |
260 | 260 | } |
261 | 261 | |
262 | - $tmpProp = '' . PHP_EOL; |
|
263 | - $tmpProp .= ' /**' . PHP_EOL; |
|
264 | - $tmpProp .= ' * @var ' . $varName . PHP_EOL; |
|
265 | - $tmpProp .= ' */' . PHP_EOL; |
|
266 | - $tmpProp .= ' private $' . $columnName . ';' . PHP_EOL; |
|
262 | + $tmpProp = ''.PHP_EOL; |
|
263 | + $tmpProp .= ' /**'.PHP_EOL; |
|
264 | + $tmpProp .= ' * @var '.$varName.PHP_EOL; |
|
265 | + $tmpProp .= ' */'.PHP_EOL; |
|
266 | + $tmpProp .= ' private $'.$columnName.';'.PHP_EOL; |
|
267 | 267 | |
268 | 268 | $prop[] = $tmpProp; |
269 | 269 | |
270 | - $tmpGetMethName = $this->toCamelCase('get_' . $columnName); |
|
270 | + $tmpGetMethName = $this->toCamelCase('get_'.$columnName); |
|
271 | 271 | |
272 | - $tmpGet = '' . PHP_EOL; |
|
273 | - $tmpGet .= ' /**' . PHP_EOL; |
|
274 | - $tmpGet .= ' * Get ' . $columnName . PHP_EOL; |
|
275 | - $tmpGet .= ' *' . PHP_EOL; |
|
276 | - $tmpGet .= ' * @return ' . $varName . PHP_EOL; |
|
277 | - $tmpGet .= ' */' . PHP_EOL; |
|
278 | - $tmpGet .= ' public function ' . $tmpGetMethName . '()' . PHP_EOL; |
|
279 | - $tmpGet .= ' {' . PHP_EOL; |
|
280 | - $tmpGet .= ' return $this->' . $columnName . ';' . PHP_EOL; |
|
281 | - $tmpGet .= ' }' . PHP_EOL; |
|
272 | + $tmpGet = ''.PHP_EOL; |
|
273 | + $tmpGet .= ' /**'.PHP_EOL; |
|
274 | + $tmpGet .= ' * Get '.$columnName.PHP_EOL; |
|
275 | + $tmpGet .= ' *'.PHP_EOL; |
|
276 | + $tmpGet .= ' * @return '.$varName.PHP_EOL; |
|
277 | + $tmpGet .= ' */'.PHP_EOL; |
|
278 | + $tmpGet .= ' public function '.$tmpGetMethName.'()'.PHP_EOL; |
|
279 | + $tmpGet .= ' {'.PHP_EOL; |
|
280 | + $tmpGet .= ' return $this->'.$columnName.';'.PHP_EOL; |
|
281 | + $tmpGet .= ' }'.PHP_EOL; |
|
282 | 282 | |
283 | 283 | $getMethods[] = $tmpGet; |
284 | 284 | |
285 | - $tmpSetMethName = $this->toCamelCase('set_' . $columnName); |
|
286 | - |
|
287 | - $tmpSet = '' . PHP_EOL; |
|
288 | - $tmpSet .= ' /**' . PHP_EOL; |
|
289 | - $tmpSet .= ' * Set ' . $columnName . PHP_EOL; |
|
290 | - $tmpSet .= ' *' . PHP_EOL; |
|
291 | - $tmpSet .= ' * @param ' . $varName . ' $' . $columnName . PHP_EOL; |
|
292 | - $tmpSet .= ' * @return ' . $nameFormated . PHP_EOL; |
|
293 | - $tmpSet .= ' */' . PHP_EOL; |
|
294 | - $tmpSet .= ' public function ' . $tmpSetMethName . '( $' . $columnName . ')' . PHP_EOL; |
|
295 | - $tmpSet .= ' {' . PHP_EOL; |
|
296 | - $tmpSet .= ' $this->' . $columnName . ' = $' . $columnName . ';' . PHP_EOL; |
|
297 | - $tmpSet .= ' return $this;' . PHP_EOL; |
|
298 | - $tmpSet .= ' }' . PHP_EOL; |
|
285 | + $tmpSetMethName = $this->toCamelCase('set_'.$columnName); |
|
286 | + |
|
287 | + $tmpSet = ''.PHP_EOL; |
|
288 | + $tmpSet .= ' /**'.PHP_EOL; |
|
289 | + $tmpSet .= ' * Set '.$columnName.PHP_EOL; |
|
290 | + $tmpSet .= ' *'.PHP_EOL; |
|
291 | + $tmpSet .= ' * @param '.$varName.' $'.$columnName.PHP_EOL; |
|
292 | + $tmpSet .= ' * @return '.$nameFormated.PHP_EOL; |
|
293 | + $tmpSet .= ' */'.PHP_EOL; |
|
294 | + $tmpSet .= ' public function '.$tmpSetMethName.'( $'.$columnName.')'.PHP_EOL; |
|
295 | + $tmpSet .= ' {'.PHP_EOL; |
|
296 | + $tmpSet .= ' $this->'.$columnName.' = $'.$columnName.';'.PHP_EOL; |
|
297 | + $tmpSet .= ' return $this;'.PHP_EOL; |
|
298 | + $tmpSet .= ' }'.PHP_EOL; |
|
299 | 299 | $setMethods[] = $tmpSet; |
300 | 300 | } |
301 | 301 | $ret .= PHP_EOL; |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | $ret .= PHP_EOL; |
306 | 306 | $ret .= join(PHP_EOL, $setMethods); |
307 | 307 | $ret .= PHP_EOL; |
308 | - $ret .= '}' . PHP_EOL; |
|
308 | + $ret .= '}'.PHP_EOL; |
|
309 | 309 | |
310 | 310 | |
311 | 311 | return $ret; |
@@ -316,16 +316,16 @@ discard block |
||
316 | 316 | $line = array(); |
317 | 317 | $line[] = '<?php'; |
318 | 318 | $line[] = '/*'; |
319 | - $line[] = ' * This file is part of ' . $pluginCode; |
|
319 | + $line[] = ' * This file is part of '.$pluginCode; |
|
320 | 320 | $line[] = ' *'; |
321 | 321 | $line[] = ' *'; |
322 | 322 | $line[] = ' * For the full copyright and license information, please view the LICENSE'; |
323 | 323 | $line[] = ' * file that was distributed with this source code.'; |
324 | 324 | $line[] = ' */'; |
325 | 325 | $line[] = ''; |
326 | - $line[] = 'namespace Plugin\\' . $pluginCode . '\Entity;'; |
|
326 | + $line[] = 'namespace Plugin\\'.$pluginCode.'\Entity;'; |
|
327 | 327 | $line[] = ''; |
328 | - $line[] = 'class ' . ucfirst($nameFormated) . ' extends \Eccube\Entity\AbstractEntity'; |
|
328 | + $line[] = 'class '.ucfirst($nameFormated).' extends \Eccube\Entity\AbstractEntity'; |
|
329 | 329 | $line[] = '{'; |
330 | 330 | $line[] = ' /**'; |
331 | 331 | $line[] = ' * @return string'; |
@@ -409,10 +409,10 @@ discard block |
||
409 | 409 | } |
410 | 410 | |
411 | 411 | $yml = array( |
412 | - 'Plugin\\' . $pluginCode . '\Entity\\' . ucfirst($nameFormated) => array( |
|
412 | + 'Plugin\\'.$pluginCode.'\Entity\\'.ucfirst($nameFormated) => array( |
|
413 | 413 | 'type' => 'entity', |
414 | 414 | 'table' => $TableInfo->getName(), |
415 | - 'repositoryClass' => 'Plugin\\' . $pluginCode . '\Repository\\' . ucfirst($nameFormated) . 'Repository', |
|
415 | + 'repositoryClass' => 'Plugin\\'.$pluginCode.'\Repository\\'.ucfirst($nameFormated).'Repository', |
|
416 | 416 | 'id' => array( |
417 | 417 | 'id' => $id |
418 | 418 | ), |
@@ -430,24 +430,24 @@ discard block |
||
430 | 430 | $line = array(); |
431 | 431 | $line[] = '<?php'; |
432 | 432 | $line[] = '/*'; |
433 | - $line[] = ' * This file is part of ' . $pluginCode; |
|
433 | + $line[] = ' * This file is part of '.$pluginCode; |
|
434 | 434 | $line[] = ' *'; |
435 | 435 | $line[] = ' *'; |
436 | 436 | $line[] = ' * For the full copyright and license information, please view the LICENSE'; |
437 | 437 | $line[] = ' * file that was distributed with this source code.'; |
438 | 438 | $line[] = ' */'; |
439 | 439 | $line[] = ''; |
440 | - $line[] = 'namespace Plugin\\' . $pluginCode . '\Repository;'; |
|
440 | + $line[] = 'namespace Plugin\\'.$pluginCode.'\Repository;'; |
|
441 | 441 | $line[] = ''; |
442 | 442 | $line[] = 'use Doctrine\ORM\EntityRepository;'; |
443 | 443 | $line[] = ''; |
444 | 444 | $line[] = '/**'; |
445 | - $line[] = ' * ' . ucfirst($nameFormated); |
|
445 | + $line[] = ' * '.ucfirst($nameFormated); |
|
446 | 446 | $line[] = ' *'; |
447 | 447 | $line[] = ' * This class was generated by the Doctrine ORM. Add your own custom'; |
448 | 448 | $line[] = ' * repository methods below.'; |
449 | 449 | $line[] = ' */'; |
450 | - $line[] = 'class ' . ucfirst($nameFormated) . 'Repository extends EntityRepository'; |
|
450 | + $line[] = 'class '.ucfirst($nameFormated).'Repository extends EntityRepository'; |
|
451 | 451 | $line[] = '{'; |
452 | 452 | $line[] = ''; |
453 | 453 | $line[] = '}'; |
@@ -458,21 +458,21 @@ discard block |
||
458 | 458 | private function makeMigration($pluginCode, $migration) |
459 | 459 | { |
460 | 460 | if ($this->paramList['supportFlag']['value']) { |
461 | - $migrationFileCont = file_get_contents($this->app['config']['root_dir'] . '/src/Eccube/Command/PluginCommand/Resource/MigrationVersionSupport.php'); |
|
461 | + $migrationFileCont = file_get_contents($this->app['config']['root_dir'].'/src/Eccube/Command/PluginCommand/Resource/MigrationVersionSupport.php'); |
|
462 | 462 | } else { |
463 | - $migrationFileCont = file_get_contents($this->app['config']['root_dir'] . '/src/Eccube/Command/PluginCommand/Resource/MigrationVersion.php'); |
|
463 | + $migrationFileCont = file_get_contents($this->app['config']['root_dir'].'/src/Eccube/Command/PluginCommand/Resource/MigrationVersion.php'); |
|
464 | 464 | } |
465 | 465 | |
466 | 466 | $entityList = $this->createEntityList($pluginCode, $migration); |
467 | 467 | |
468 | - $entityListStr = join(',' . PHP_EOL, $entityList); |
|
468 | + $entityListStr = join(','.PHP_EOL, $entityList); |
|
469 | 469 | $migrationFileCont = str_replace('[entityList]', $entityListStr, $migrationFileCont); |
470 | 470 | |
471 | 471 | if ($this->paramList['supportFlag']['value']) { |
472 | 472 | $createParts = $this->makeCreateParts($migration); |
473 | 473 | $tableNameArr = array(); |
474 | 474 | foreach ($createParts as $tableName => $tableArr) { |
475 | - $tableNameArr[] = ' $this->createTable' . $tableName . '($schema);'; |
|
475 | + $tableNameArr[] = ' $this->createTable'.$tableName.'($schema);'; |
|
476 | 476 | } |
477 | 477 | $tableNameStr = join(PHP_EOL, $tableNameArr); |
478 | 478 | $migrationFileCont = str_replace('[createTable]', $tableNameStr, $migrationFileCont); |
@@ -495,7 +495,7 @@ discard block |
||
495 | 495 | { |
496 | 496 | $ret = array(); |
497 | 497 | foreach ($migration as $TableInfo) { |
498 | - $ret[] = " '" . 'Plugin\\' . $pluginCode . '\Entity\\' . ucfirst($this->getShortClassName($TableInfo->getName())) . "'"; |
|
498 | + $ret[] = " '".'Plugin\\'.$pluginCode.'\Entity\\'.ucfirst($this->getShortClassName($TableInfo->getName()))."'"; |
|
499 | 499 | } |
500 | 500 | return $ret; |
501 | 501 | } |
@@ -512,14 +512,14 @@ discard block |
||
512 | 512 | $nameFormated = $this->getShortClassName($TableInfo->getName()); |
513 | 513 | $tmp = array(); |
514 | 514 | $tmp[] = PHP_EOL; |
515 | - $tmp[] = ' public function createTable' . ucfirst($nameFormated) . '(Schema $schema)'; |
|
515 | + $tmp[] = ' public function createTable'.ucfirst($nameFormated).'(Schema $schema)'; |
|
516 | 516 | $tmp[] = ' {'; |
517 | - $tmp[] = ' $table = $schema->createTable(\'' . $TableInfo->getName() . '\');'; |
|
517 | + $tmp[] = ' $table = $schema->createTable(\''.$TableInfo->getName().'\');'; |
|
518 | 518 | $columns = $TableInfo->getColumns(); |
519 | 519 | foreach ($columns as $column) { |
520 | 520 | |
521 | 521 | $typeName = $column->getType()->getName(); |
522 | - $tmp[] = ' $table->addColumn(\'' . $column->getName() . '\', \'' . $typeName . '\', array('; |
|
522 | + $tmp[] = ' $table->addColumn(\''.$column->getName().'\', \''.$typeName.'\', array('; |
|
523 | 523 | $param = array(); |
524 | 524 | if ($column->getNotNull()) { |
525 | 525 | $param['notnull'] = 'true'; |
@@ -530,16 +530,16 @@ discard block |
||
530 | 530 | $param['unsigned'] = 'true'; |
531 | 531 | } |
532 | 532 | if ($column->getDefault()) { |
533 | - $param['default'] = '\'' . $column->getDefault() . '\''; |
|
533 | + $param['default'] = '\''.$column->getDefault().'\''; |
|
534 | 534 | } |
535 | 535 | if ($column->getAutoincrement()) { |
536 | 536 | $param['autoincrement'] = 'true'; |
537 | 537 | } |
538 | 538 | if ($column->getComment()) { |
539 | - $param['comment'] = '\'' . str_replace('\'', '\\\'', $column->getComment()) . '\''; |
|
539 | + $param['comment'] = '\''.str_replace('\'', '\\\'', $column->getComment()).'\''; |
|
540 | 540 | } |
541 | 541 | if ($column->getLength()) { |
542 | - $param['length'] = '\'' . $column->getLength() . '\''; |
|
542 | + $param['length'] = '\''.$column->getLength().'\''; |
|
543 | 543 | } |
544 | 544 | |
545 | 545 | if ($typeName == 'decimal') { |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | $param['scale'] = $column->getScale(); |
548 | 548 | } |
549 | 549 | foreach ($param as $parKey => $parVal) { |
550 | - $tmp[] = ' \'' . $parKey . '\' => ' . $parVal . ','; |
|
550 | + $tmp[] = ' \''.$parKey.'\' => '.$parVal.','; |
|
551 | 551 | } |
552 | 552 | $tmp[] = ' ));'; |
553 | 553 | } |
@@ -557,20 +557,20 @@ discard block |
||
557 | 557 | if ($index->isPrimary()) { |
558 | 558 | $tmpCol = $index->getColumns(); |
559 | 559 | foreach ($tmpCol as $colName) { |
560 | - $tmp[] = ' $table->setPrimaryKey(array(\'' . $colName . '\'));'; |
|
560 | + $tmp[] = ' $table->setPrimaryKey(array(\''.$colName.'\'));'; |
|
561 | 561 | break; |
562 | 562 | } |
563 | 563 | } else { |
564 | 564 | $tmp[] = ' $columnNames = array();'; |
565 | 565 | foreach ($index->getColumns() as $IdentName) { |
566 | - $tmp[] = ' $columnNames[] = \'' . $IdentName . '\';'; |
|
566 | + $tmp[] = ' $columnNames[] = \''.$IdentName.'\';'; |
|
567 | 567 | } |
568 | - $tmp[] = ' $indexName = \'' . $index->getName() . '\';'; |
|
569 | - $tmp[] = ' $options = ' . var_export($index->getOptions(), true) . ';'; |
|
568 | + $tmp[] = ' $indexName = \''.$index->getName().'\';'; |
|
569 | + $tmp[] = ' $options = '.var_export($index->getOptions(), true).';'; |
|
570 | 570 | if ($index->isUnique()) { |
571 | 571 | $tmp[] = ' $table->addUniqueIndex($columnNames, $indexName, $options);'; |
572 | 572 | } else { |
573 | - $tmp[] = ' $flags = ' . var_export($index->getFlags(), true) . ';'; |
|
573 | + $tmp[] = ' $flags = '.var_export($index->getFlags(), true).';'; |
|
574 | 574 | $tmp[] = ' $table->addIndex($columnNames, $indexName,$flags, $options);'; |
575 | 575 | } |
576 | 576 | } |
@@ -587,7 +587,7 @@ discard block |
||
587 | 587 | { |
588 | 588 | $ret = array(); |
589 | 589 | foreach ($migration as $TableInfo) { |
590 | - $ret[] = ' $schema->dropTable(\'' . $TableInfo->getName() . '\');'; |
|
590 | + $ret[] = ' $schema->dropTable(\''.$TableInfo->getName().'\');'; |
|
591 | 591 | } |
592 | 592 | |
593 | 593 | return $ret; |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | foreach ($data as $row) { |
109 | 109 | |
110 | 110 | if ($headerSize != count($row)) { |
111 | - $this->addErrors(($data->key() + 1) . '行目のCSVフォーマットが一致しません。'); |
|
111 | + $this->addErrors(($data->key() + 1).'行目のCSVフォーマットが一致しません。'); |
|
112 | 112 | return $this->render($app, $form, $headers, $this->productTwig); |
113 | 113 | } |
114 | 114 | |
@@ -119,33 +119,33 @@ discard block |
||
119 | 119 | if (preg_match('/^\d+$/', $row['商品ID'])) { |
120 | 120 | $Product = $app['eccube.repository.product']->find($row['商品ID']); |
121 | 121 | if (!$Product) { |
122 | - $this->addErrors(($data->key() + 1) . '行目の商品IDが存在しません。'); |
|
122 | + $this->addErrors(($data->key() + 1).'行目の商品IDが存在しません。'); |
|
123 | 123 | return $this->render($app, $form, $headers, $this->productTwig); |
124 | 124 | } |
125 | 125 | } else { |
126 | - $this->addErrors(($data->key() + 1) . '行目の商品IDが存在しません。'); |
|
126 | + $this->addErrors(($data->key() + 1).'行目の商品IDが存在しません。'); |
|
127 | 127 | return $this->render($app, $form, $headers, $this->productTwig); |
128 | 128 | } |
129 | 129 | |
130 | 130 | } |
131 | 131 | |
132 | 132 | if ($row['公開ステータス(ID)'] == '') { |
133 | - $this->addErrors(($data->key() + 1) . '行目の公開ステータス(ID)が設定されていません。'); |
|
133 | + $this->addErrors(($data->key() + 1).'行目の公開ステータス(ID)が設定されていません。'); |
|
134 | 134 | } else { |
135 | 135 | if (preg_match('/^\d+$/', $row['公開ステータス(ID)'])) { |
136 | 136 | $Disp = $app['eccube.repository.master.disp']->find($row['公開ステータス(ID)']); |
137 | 137 | if (!$Disp) { |
138 | - $this->addErrors(($data->key() + 1) . '行目の公開ステータス(ID)が存在しません。'); |
|
138 | + $this->addErrors(($data->key() + 1).'行目の公開ステータス(ID)が存在しません。'); |
|
139 | 139 | } else { |
140 | 140 | $Product->setStatus($Disp); |
141 | 141 | } |
142 | 142 | } else { |
143 | - $this->addErrors(($data->key() + 1) . '行目の公開ステータス(ID)が存在しません。'); |
|
143 | + $this->addErrors(($data->key() + 1).'行目の公開ステータス(ID)が存在しません。'); |
|
144 | 144 | } |
145 | 145 | } |
146 | 146 | |
147 | 147 | if (Str::isBlank($row['商品名'])) { |
148 | - $this->addErrors(($data->key() + 1) . '行目の商品名が設定されていません。'); |
|
148 | + $this->addErrors(($data->key() + 1).'行目の商品名が設定されていません。'); |
|
149 | 149 | return $this->render($app, $form, $headers, $this->productTwig); |
150 | 150 | } else { |
151 | 151 | $Product->setName(Str::trimAll($row['商品名'])); |
@@ -184,10 +184,10 @@ discard block |
||
184 | 184 | if ($row['商品削除フラグ'] == '') { |
185 | 185 | $Product->setDelFlg(Constant::DISABLED); |
186 | 186 | } else { |
187 | - if ($row['商品削除フラグ'] == (string)Constant::DISABLED || $row['商品削除フラグ'] == (string)Constant::ENABLED) { |
|
187 | + if ($row['商品削除フラグ'] == (string) Constant::DISABLED || $row['商品削除フラグ'] == (string) Constant::ENABLED) { |
|
188 | 188 | $Product->setDelFlg($row['商品削除フラグ']); |
189 | 189 | } else { |
190 | - $this->addErrors(($data->key() + 1) . '行目の商品削除フラグが設定されていません。'); |
|
190 | + $this->addErrors(($data->key() + 1).'行目の商品削除フラグが設定されていません。'); |
|
191 | 191 | return $this->render($app, $form, $headers, $this->productTwig); |
192 | 192 | } |
193 | 193 | } |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | if (preg_match('/^\d+$/', $deliveryFee) && $deliveryFee >= 0) { |
215 | 215 | $ProductClassOrg->setDeliveryFee($deliveryFee); |
216 | 216 | } else { |
217 | - $this->addErrors(($data->key() + 1) . '行目の送料は0以上の数値を設定してください。'); |
|
217 | + $this->addErrors(($data->key() + 1).'行目の送料は0以上の数値を設定してください。'); |
|
218 | 218 | } |
219 | 219 | } |
220 | 220 | } |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | if ($row['規格分類1(ID)'] != '') { |
223 | 223 | |
224 | 224 | if ($row['規格分類1(ID)'] == $row['規格分類2(ID)']) { |
225 | - $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)と規格分類2(ID)には同じ値を使用できません。'); |
|
225 | + $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)と規格分類2(ID)には同じ値を使用できません。'); |
|
226 | 226 | } else { |
227 | 227 | // 商品規格あり |
228 | 228 | // 企画分類あり商品を作成 |
@@ -237,30 +237,30 @@ discard block |
||
237 | 237 | if (preg_match('/^\d+$/', $row['規格分類1(ID)'])) { |
238 | 238 | $ClassCategory1 = $app['eccube.repository.class_category']->find($row['規格分類1(ID)']); |
239 | 239 | if (!$ClassCategory1) { |
240 | - $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)が存在しません。'); |
|
240 | + $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)が存在しません。'); |
|
241 | 241 | } else { |
242 | 242 | $ProductClass->setClassCategory1($ClassCategory1); |
243 | 243 | } |
244 | 244 | } else { |
245 | - $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)が存在しません。'); |
|
245 | + $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)が存在しません。'); |
|
246 | 246 | } |
247 | 247 | |
248 | 248 | if ($row['規格分類2(ID)'] != '') { |
249 | 249 | if (preg_match('/^\d+$/', $row['規格分類2(ID)'])) { |
250 | 250 | $ClassCategory2 = $app['eccube.repository.class_category']->find($row['規格分類2(ID)']); |
251 | 251 | if (!$ClassCategory2) { |
252 | - $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)が存在しません。'); |
|
252 | + $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)が存在しません。'); |
|
253 | 253 | } else { |
254 | 254 | if ($ClassCategory1 && |
255 | 255 | ($ClassCategory1->getClassName()->getId() == $ClassCategory2->getClassName()->getId()) |
256 | 256 | ) { |
257 | - $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)と規格分類2(ID)の規格名が同じです。'); |
|
257 | + $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)と規格分類2(ID)の規格名が同じです。'); |
|
258 | 258 | } else { |
259 | 259 | $ProductClass->setClassCategory2($ClassCategory2); |
260 | 260 | } |
261 | 261 | } |
262 | 262 | } else { |
263 | - $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)が存在しません。'); |
|
263 | + $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)が存在しません。'); |
|
264 | 264 | } |
265 | 265 | } |
266 | 266 | $ProductClass->setProductStock($ProductStock); |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | |
273 | 273 | } else { |
274 | 274 | if ($row['規格分類2(ID)'] != '') { |
275 | - $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)が存在しません。'); |
|
275 | + $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)が存在しません。'); |
|
276 | 276 | } |
277 | 277 | } |
278 | 278 | |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | if (preg_match('/^\d+$/', $deliveryFee) && $deliveryFee >= 0) { |
301 | 301 | $pc->setDeliveryFee($deliveryFee); |
302 | 302 | } else { |
303 | - $this->addErrors(($data->key() + 1) . '行目の送料は0以上の数値を設定してください。'); |
|
303 | + $this->addErrors(($data->key() + 1).'行目の送料は0以上の数値を設定してください。'); |
|
304 | 304 | } |
305 | 305 | } |
306 | 306 | } |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | } |
323 | 323 | |
324 | 324 | if ($row['規格分類1(ID)'] == $row['規格分類2(ID)']) { |
325 | - $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)と規格分類2(ID)には同じ値を使用できません。'); |
|
325 | + $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)と規格分類2(ID)には同じ値を使用できません。'); |
|
326 | 326 | } else { |
327 | 327 | |
328 | 328 | // 必ず規格分類1がセットされている |
@@ -331,36 +331,36 @@ discard block |
||
331 | 331 | if (preg_match('/^\d+$/', $classCategoryId1)) { |
332 | 332 | $ClassCategory1 = $app['eccube.repository.class_category']->find($classCategoryId1); |
333 | 333 | if (!$ClassCategory1) { |
334 | - $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)が存在しません。'); |
|
334 | + $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)が存在しません。'); |
|
335 | 335 | } |
336 | 336 | } else { |
337 | - $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)が存在しません。'); |
|
337 | + $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)が存在しません。'); |
|
338 | 338 | } |
339 | 339 | |
340 | 340 | $ClassCategory2 = null; |
341 | 341 | if ($row['規格分類2(ID)'] != '') { |
342 | 342 | if ($pc->getClassCategory1() != null && $pc->getClassCategory2() == null) { |
343 | - $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)は設定できません。'); |
|
343 | + $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)は設定できません。'); |
|
344 | 344 | } else { |
345 | 345 | if (preg_match('/^\d+$/', $classCategoryId2)) { |
346 | 346 | $ClassCategory2 = $app['eccube.repository.class_category']->find($classCategoryId2); |
347 | 347 | if (!$ClassCategory2) { |
348 | - $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)が存在しません。'); |
|
348 | + $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)が存在しません。'); |
|
349 | 349 | } else { |
350 | 350 | if ($ClassCategory1 && |
351 | 351 | ($ClassCategory1->getClassName()->getId() == $ClassCategory2->getClassName()->getId()) |
352 | 352 | ) { |
353 | - $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)と規格分類2(ID)の規格名が同じです。'); |
|
353 | + $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)と規格分類2(ID)の規格名が同じです。'); |
|
354 | 354 | } |
355 | 355 | } |
356 | 356 | } else { |
357 | - $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)が存在しません。'); |
|
357 | + $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)が存在しません。'); |
|
358 | 358 | } |
359 | 359 | |
360 | 360 | } |
361 | 361 | } else { |
362 | 362 | if ($pc->getClassCategory1() != null && $pc->getClassCategory2() != null) { |
363 | - $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)に値を設定してください。'); |
|
363 | + $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)に値を設定してください。'); |
|
364 | 364 | } |
365 | 365 | } |
366 | 366 | $ProductClass = $this->createProductClass($row, $Product, $app, $data, $ClassCategory1, $ClassCategory2); |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | if (preg_match('/^\d+$/', $deliveryFee) && $deliveryFee >= 0) { |
372 | 372 | $ProductClass->setDeliveryFee($deliveryFee); |
373 | 373 | } else { |
374 | - $this->addErrors(($data->key() + 1) . '行目の送料は0以上の数値を設定してください。'); |
|
374 | + $this->addErrors(($data->key() + 1).'行目の送料は0以上の数値を設定してください。'); |
|
375 | 375 | } |
376 | 376 | } |
377 | 377 | } |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | foreach ($data as $row) { |
459 | 459 | |
460 | 460 | if ($headerSize != count($row)) { |
461 | - $this->addErrors(($data->key() + 1) . '行目のCSVフォーマットが一致しません。'); |
|
461 | + $this->addErrors(($data->key() + 1).'行目のCSVフォーマットが一致しません。'); |
|
462 | 462 | return $this->render($app, $form, $headers, $this->categoryTwig); |
463 | 463 | } |
464 | 464 | |
@@ -466,23 +466,23 @@ discard block |
||
466 | 466 | $Category = new Category(); |
467 | 467 | } else { |
468 | 468 | if (!preg_match('/^\d+$/', $row['カテゴリID'])) { |
469 | - $this->addErrors(($data->key() + 1) . '行目のカテゴリIDが存在しません。'); |
|
469 | + $this->addErrors(($data->key() + 1).'行目のカテゴリIDが存在しません。'); |
|
470 | 470 | return $this->render($app, $form, $headers, $this->categoryTwig); |
471 | 471 | } |
472 | 472 | $Category = $app['eccube.repository.category']->find($row['カテゴリID']); |
473 | 473 | if (!$Category) { |
474 | - $this->addErrors(($data->key() + 1) . '行目のカテゴリIDが存在しません。'); |
|
474 | + $this->addErrors(($data->key() + 1).'行目のカテゴリIDが存在しません。'); |
|
475 | 475 | return $this->render($app, $form, $headers, $this->categoryTwig); |
476 | 476 | } |
477 | 477 | if ($row['カテゴリID'] == $row['親カテゴリID']) { |
478 | - $this->addErrors(($data->key() + 1) . '行目のカテゴリIDと親カテゴリIDが同じです。'); |
|
478 | + $this->addErrors(($data->key() + 1).'行目のカテゴリIDと親カテゴリIDが同じです。'); |
|
479 | 479 | return $this->render($app, $form, $headers, $this->categoryTwig); |
480 | 480 | } |
481 | 481 | |
482 | 482 | } |
483 | 483 | |
484 | 484 | if (Str::isBlank($row['カテゴリ名'])) { |
485 | - $this->addErrors(($data->key() + 1) . '行目のカテゴリ名が設定されていません。'); |
|
485 | + $this->addErrors(($data->key() + 1).'行目のカテゴリ名が設定されていません。'); |
|
486 | 486 | return $this->render($app, $form, $headers, $this->categoryTwig); |
487 | 487 | } else { |
488 | 488 | $Category->setName(Str::trimAll($row['カテゴリ名'])); |
@@ -491,13 +491,13 @@ discard block |
||
491 | 491 | if ($row['親カテゴリID'] != '') { |
492 | 492 | |
493 | 493 | if (!preg_match('/^\d+$/', $row['親カテゴリID'])) { |
494 | - $this->addErrors(($data->key() + 1) . '行目の親カテゴリIDが存在しません。'); |
|
494 | + $this->addErrors(($data->key() + 1).'行目の親カテゴリIDが存在しません。'); |
|
495 | 495 | return $this->render($app, $form, $headers, $this->categoryTwig); |
496 | 496 | } |
497 | 497 | |
498 | 498 | $ParentCategory = $app['eccube.repository.category']->find($row['親カテゴリID']); |
499 | 499 | if (!$ParentCategory) { |
500 | - $this->addErrors(($data->key() + 1) . '行目の親カテゴリIDが存在しません。'); |
|
500 | + $this->addErrors(($data->key() + 1).'行目の親カテゴリIDが存在しません。'); |
|
501 | 501 | return $this->render($app, $form, $headers, $this->categoryTwig); |
502 | 502 | } |
503 | 503 | |
@@ -513,14 +513,14 @@ discard block |
||
513 | 513 | } |
514 | 514 | |
515 | 515 | if ($app['config']['category_nest_level'] < $Category->getLevel()) { |
516 | - $this->addErrors(($data->key() + 1) . '行目のカテゴリが最大レベルを超えているため設定できません。'); |
|
516 | + $this->addErrors(($data->key() + 1).'行目のカテゴリが最大レベルを超えているため設定できません。'); |
|
517 | 517 | return $this->render($app, $form, $headers, $this->categoryTwig); |
518 | 518 | } |
519 | 519 | |
520 | 520 | $status = $app['eccube.repository.category']->save($Category); |
521 | 521 | |
522 | 522 | if (!$status) { |
523 | - $this->addErrors(($data->key() + 1) . '行目のカテゴリが設定できません。'); |
|
523 | + $this->addErrors(($data->key() + 1).'行目のカテゴリが設定できません。'); |
|
524 | 524 | } |
525 | 525 | |
526 | 526 | if ($this->hasErrors()) { |
@@ -565,7 +565,7 @@ discard block |
||
565 | 565 | throw new NotFoundHttpException(); |
566 | 566 | } |
567 | 567 | |
568 | - $response->setCallback(function () use ($app, $request, $headers) { |
|
568 | + $response->setCallback(function() use ($app, $request, $headers) { |
|
569 | 569 | |
570 | 570 | // ヘッダ行の出力 |
571 | 571 | $row = array(); |
@@ -580,7 +580,7 @@ discard block |
||
580 | 580 | }); |
581 | 581 | |
582 | 582 | $response->headers->set('Content-Type', 'application/octet-stream'); |
583 | - $response->headers->set('Content-Disposition', 'attachment; filename=' . $filename); |
|
583 | + $response->headers->set('Content-Disposition', 'attachment; filename='.$filename); |
|
584 | 584 | $response->send(); |
585 | 585 | |
586 | 586 | return $response; |
@@ -603,7 +603,7 @@ discard block |
||
603 | 603 | if (!empty($this->fileName)) { |
604 | 604 | try { |
605 | 605 | $fs = new Filesystem(); |
606 | - $fs->remove($app['config']['csv_temp_realdir'] . '/' . $this->fileName); |
|
606 | + $fs->remove($app['config']['csv_temp_realdir'].'/'.$this->fileName); |
|
607 | 607 | } catch (\Exception $e) { |
608 | 608 | // エラーが発生しても無視する |
609 | 609 | } |
@@ -626,10 +626,10 @@ discard block |
||
626 | 626 | protected function getImportData($app, $formFile) |
627 | 627 | { |
628 | 628 | // アップロードされたCSVファイルを一時ディレクトリに保存 |
629 | - $this->fileName = 'upload_' . Str::random() . '.' . $formFile->getClientOriginalExtension(); |
|
629 | + $this->fileName = 'upload_'.Str::random().'.'.$formFile->getClientOriginalExtension(); |
|
630 | 630 | $formFile->move($app['config']['csv_temp_realdir'], $this->fileName); |
631 | 631 | |
632 | - $file = file_get_contents($app['config']['csv_temp_realdir'] . '/' . $this->fileName); |
|
632 | + $file = file_get_contents($app['config']['csv_temp_realdir'].'/'.$this->fileName); |
|
633 | 633 | |
634 | 634 | if ('\\' === DIRECTORY_SEPARATOR && PHP_VERSION_ID >= 70000) { |
635 | 635 | // Windows 環境の PHP7 の場合はファイルエンコーディングを CP932 に合わせる |
@@ -725,8 +725,8 @@ discard block |
||
725 | 725 | if (!$Category) { |
726 | 726 | $this->addErrors(($data->key() + 1).'行目の商品カテゴリ(ID)「'.$category.'」が存在しません。'); |
727 | 727 | } else { |
728 | - foreach($Category->getPath() as $ParentCategory){ |
|
729 | - if (!isset($categoriesIdList[$ParentCategory->getId()])){ |
|
728 | + foreach ($Category->getPath() as $ParentCategory) { |
|
729 | + if (!isset($categoriesIdList[$ParentCategory->getId()])) { |
|
730 | 730 | $ProductCategory = $this->makeProductCategory($Product, $ParentCategory, $rank); |
731 | 731 | $app['orm.em']->persist($ProductCategory); |
732 | 732 | $rank++; |
@@ -734,7 +734,7 @@ discard block |
||
734 | 734 | $categoriesIdList[$ParentCategory->getId()] = true; |
735 | 735 | } |
736 | 736 | } |
737 | - if (!isset($categoriesIdList[$Category->getId()])){ |
|
737 | + if (!isset($categoriesIdList[$Category->getId()])) { |
|
738 | 738 | $ProductCategory = $this->makeProductCategory($Product, $Category, $rank); |
739 | 739 | $rank++; |
740 | 740 | $this->em->persist($ProductCategory); |
@@ -789,7 +789,7 @@ discard block |
||
789 | 789 | } |
790 | 790 | } |
791 | 791 | if (!$Tag) { |
792 | - $this->addErrors(($data->key() + 1) . '行目のタグ(ID)「' . $tag_id . '」が存在しません。'); |
|
792 | + $this->addErrors(($data->key() + 1).'行目のタグ(ID)「'.$tag_id.'」が存在しません。'); |
|
793 | 793 | } |
794 | 794 | } |
795 | 795 | } |
@@ -807,17 +807,17 @@ discard block |
||
807 | 807 | |
808 | 808 | |
809 | 809 | if ($row['商品種別(ID)'] == '') { |
810 | - $this->addErrors(($data->key() + 1) . '行目の商品種別(ID)が設定されていません。'); |
|
810 | + $this->addErrors(($data->key() + 1).'行目の商品種別(ID)が設定されていません。'); |
|
811 | 811 | } else { |
812 | 812 | if (preg_match('/^\d+$/', $row['商品種別(ID)'])) { |
813 | 813 | $ProductType = $app['eccube.repository.master.product_type']->find($row['商品種別(ID)']); |
814 | 814 | if (!$ProductType) { |
815 | - $this->addErrors(($data->key() + 1) . '行目の商品種別(ID)が存在しません。'); |
|
815 | + $this->addErrors(($data->key() + 1).'行目の商品種別(ID)が存在しません。'); |
|
816 | 816 | } else { |
817 | 817 | $ProductClass->setProductType($ProductType); |
818 | 818 | } |
819 | 819 | } else { |
820 | - $this->addErrors(($data->key() + 1) . '行目の商品種別(ID)が存在しません。'); |
|
820 | + $this->addErrors(($data->key() + 1).'行目の商品種別(ID)が存在しません。'); |
|
821 | 821 | } |
822 | 822 | } |
823 | 823 | |
@@ -828,12 +828,12 @@ discard block |
||
828 | 828 | if (preg_match('/^\d+$/', $row['発送日目安(ID)'])) { |
829 | 829 | $DeliveryDate = $app['eccube.repository.delivery_date']->find($row['発送日目安(ID)']); |
830 | 830 | if (!$DeliveryDate) { |
831 | - $this->addErrors(($data->key() + 1) . '行目の発送日目安(ID)が存在しません。'); |
|
831 | + $this->addErrors(($data->key() + 1).'行目の発送日目安(ID)が存在しません。'); |
|
832 | 832 | } else { |
833 | 833 | $ProductClass->setDeliveryDate($DeliveryDate); |
834 | 834 | } |
835 | 835 | } else { |
836 | - $this->addErrors(($data->key() + 1) . '行目の発送日目安(ID)が存在しません。'); |
|
836 | + $this->addErrors(($data->key() + 1).'行目の発送日目安(ID)が存在しません。'); |
|
837 | 837 | } |
838 | 838 | } |
839 | 839 | |
@@ -844,19 +844,19 @@ discard block |
||
844 | 844 | } |
845 | 845 | |
846 | 846 | if ($row['在庫数無制限フラグ'] == '') { |
847 | - $this->addErrors(($data->key() + 1) . '行目の在庫数無制限フラグが設定されていません。'); |
|
847 | + $this->addErrors(($data->key() + 1).'行目の在庫数無制限フラグが設定されていません。'); |
|
848 | 848 | } else { |
849 | 849 | if ($row['在庫数無制限フラグ'] == (string) Constant::DISABLED) { |
850 | 850 | $ProductClass->setStockUnlimited(Constant::DISABLED); |
851 | 851 | // 在庫数が設定されていなければエラー |
852 | 852 | if ($row['在庫数'] == '') { |
853 | - $this->addErrors(($data->key() + 1) . '行目の在庫数が設定されていません。'); |
|
853 | + $this->addErrors(($data->key() + 1).'行目の在庫数が設定されていません。'); |
|
854 | 854 | } else { |
855 | 855 | $stock = str_replace(',', '', $row['在庫数']); |
856 | 856 | if (preg_match('/^\d+$/', $stock) && $stock >= 0) { |
857 | 857 | $ProductClass->setStock($stock); |
858 | 858 | } else { |
859 | - $this->addErrors(($data->key() + 1) . '行目の在庫数は0以上の数値を設定してください。'); |
|
859 | + $this->addErrors(($data->key() + 1).'行目の在庫数は0以上の数値を設定してください。'); |
|
860 | 860 | } |
861 | 861 | } |
862 | 862 | |
@@ -864,7 +864,7 @@ discard block |
||
864 | 864 | $ProductClass->setStockUnlimited(Constant::ENABLED); |
865 | 865 | $ProductClass->setStock(null); |
866 | 866 | } else { |
867 | - $this->addErrors(($data->key() + 1) . '行目の在庫数無制限フラグが設定されていません。'); |
|
867 | + $this->addErrors(($data->key() + 1).'行目の在庫数無制限フラグが設定されていません。'); |
|
868 | 868 | } |
869 | 869 | } |
870 | 870 | |
@@ -873,7 +873,7 @@ discard block |
||
873 | 873 | if (preg_match('/^\d+$/', $saleLimit) && $saleLimit >= 0) { |
874 | 874 | $ProductClass->setSaleLimit($saleLimit); |
875 | 875 | } else { |
876 | - $this->addErrors(($data->key() + 1) . '行目の販売制限数は0以上の数値を設定してください。'); |
|
876 | + $this->addErrors(($data->key() + 1).'行目の販売制限数は0以上の数値を設定してください。'); |
|
877 | 877 | } |
878 | 878 | } |
879 | 879 | |
@@ -882,18 +882,18 @@ discard block |
||
882 | 882 | if (preg_match('/^\d+$/', $price01) && $price01 >= 0) { |
883 | 883 | $ProductClass->setPrice01($price01); |
884 | 884 | } else { |
885 | - $this->addErrors(($data->key() + 1) . '行目の通常価格は0以上の数値を設定してください。'); |
|
885 | + $this->addErrors(($data->key() + 1).'行目の通常価格は0以上の数値を設定してください。'); |
|
886 | 886 | } |
887 | 887 | } |
888 | 888 | |
889 | 889 | if ($row['販売価格'] == '') { |
890 | - $this->addErrors(($data->key() + 1) . '行目の販売価格が設定されていません。'); |
|
890 | + $this->addErrors(($data->key() + 1).'行目の販売価格が設定されていません。'); |
|
891 | 891 | } else { |
892 | 892 | $price02 = str_replace(',', '', $row['販売価格']); |
893 | 893 | if (preg_match('/^\d+$/', $price02) && $price02 >= 0) { |
894 | 894 | $ProductClass->setPrice02($price02); |
895 | 895 | } else { |
896 | - $this->addErrors(($data->key() + 1) . '行目の販売価格は0以上の数値を設定してください。'); |
|
896 | + $this->addErrors(($data->key() + 1).'行目の販売価格は0以上の数値を設定してください。'); |
|
897 | 897 | } |
898 | 898 | } |
899 | 899 | |
@@ -902,7 +902,7 @@ discard block |
||
902 | 902 | if (preg_match('/^\d+$/', $delivery_fee) && $delivery_fee >= 0) { |
903 | 903 | $ProductClass->setDeliveryFee($delivery_fee); |
904 | 904 | } else { |
905 | - $this->addErrors(($data->key() + 1) . '行目の送料は0以上の数値を設定してください。'); |
|
905 | + $this->addErrors(($data->key() + 1).'行目の送料は0以上の数値を設定してください。'); |
|
906 | 906 | } |
907 | 907 | } |
908 | 908 | |
@@ -912,7 +912,7 @@ discard block |
||
912 | 912 | if ($row['商品規格削除フラグ'] == (string) Constant::DISABLED || $row['商品規格削除フラグ'] == (string) Constant::ENABLED) { |
913 | 913 | $ProductClass->setDelFlg($row['商品規格削除フラグ']); |
914 | 914 | } else { |
915 | - $this->addErrors(($data->key() + 1) . '行目の商品規格削除フラグが設定されていません。'); |
|
915 | + $this->addErrors(($data->key() + 1).'行目の商品規格削除フラグが設定されていません。'); |
|
916 | 916 | } |
917 | 917 | } |
918 | 918 | |
@@ -945,17 +945,17 @@ discard block |
||
945 | 945 | $ProductClass->setProduct($Product); |
946 | 946 | |
947 | 947 | if ($row['商品種別(ID)'] == '') { |
948 | - $this->addErrors(($data->key() + 1) . '行目の商品種別(ID)が設定されていません。'); |
|
948 | + $this->addErrors(($data->key() + 1).'行目の商品種別(ID)が設定されていません。'); |
|
949 | 949 | } else { |
950 | 950 | if (preg_match('/^\d+$/', $row['商品種別(ID)'])) { |
951 | 951 | $ProductType = $app['eccube.repository.master.product_type']->find($row['商品種別(ID)']); |
952 | 952 | if (!$ProductType) { |
953 | - $this->addErrors(($data->key() + 1) . '行目の商品種別(ID)が存在しません。'); |
|
953 | + $this->addErrors(($data->key() + 1).'行目の商品種別(ID)が存在しません。'); |
|
954 | 954 | } else { |
955 | 955 | $ProductClass->setProductType($ProductType); |
956 | 956 | } |
957 | 957 | } else { |
958 | - $this->addErrors(($data->key() + 1) . '行目の商品種別(ID)が存在しません。'); |
|
958 | + $this->addErrors(($data->key() + 1).'行目の商品種別(ID)が存在しません。'); |
|
959 | 959 | } |
960 | 960 | } |
961 | 961 | |
@@ -964,12 +964,12 @@ discard block |
||
964 | 964 | if (preg_match('/^\d+$/', $row['規格分類1(ID)'])) { |
965 | 965 | $ClassCategory = $app['eccube.repository.class_category']->find($row['規格分類1(ID)']); |
966 | 966 | if (!$ClassCategory) { |
967 | - $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)が存在しません。'); |
|
967 | + $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)が存在しません。'); |
|
968 | 968 | } else { |
969 | 969 | $ProductClass->setClassCategory1($ClassCategory); |
970 | 970 | } |
971 | 971 | } else { |
972 | - $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)が存在しません。'); |
|
972 | + $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)が存在しません。'); |
|
973 | 973 | } |
974 | 974 | } |
975 | 975 | |
@@ -977,12 +977,12 @@ discard block |
||
977 | 977 | if (preg_match('/^\d+$/', $row['規格分類2(ID)'])) { |
978 | 978 | $ClassCategory = $app['eccube.repository.class_category']->find($row['規格分類2(ID)']); |
979 | 979 | if (!$ClassCategory) { |
980 | - $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)が存在しません。'); |
|
980 | + $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)が存在しません。'); |
|
981 | 981 | } else { |
982 | 982 | $ProductClass->setClassCategory2($ClassCategory); |
983 | 983 | } |
984 | 984 | } else { |
985 | - $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)が存在しません。'); |
|
985 | + $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)が存在しません。'); |
|
986 | 986 | } |
987 | 987 | } |
988 | 988 | |
@@ -990,12 +990,12 @@ discard block |
||
990 | 990 | if (preg_match('/^\d+$/', $row['発送日目安(ID)'])) { |
991 | 991 | $DeliveryDate = $app['eccube.repository.delivery_date']->find($row['発送日目安(ID)']); |
992 | 992 | if (!$DeliveryDate) { |
993 | - $this->addErrors(($data->key() + 1) . '行目の発送日目安(ID)が存在しません。'); |
|
993 | + $this->addErrors(($data->key() + 1).'行目の発送日目安(ID)が存在しません。'); |
|
994 | 994 | } else { |
995 | 995 | $ProductClass->setDeliveryDate($DeliveryDate); |
996 | 996 | } |
997 | 997 | } else { |
998 | - $this->addErrors(($data->key() + 1) . '行目の発送日目安(ID)が存在しません。'); |
|
998 | + $this->addErrors(($data->key() + 1).'行目の発送日目安(ID)が存在しません。'); |
|
999 | 999 | } |
1000 | 1000 | } |
1001 | 1001 | |
@@ -1006,19 +1006,19 @@ discard block |
||
1006 | 1006 | } |
1007 | 1007 | |
1008 | 1008 | if ($row['在庫数無制限フラグ'] == '') { |
1009 | - $this->addErrors(($data->key() + 1) . '行目の在庫数無制限フラグが設定されていません。'); |
|
1009 | + $this->addErrors(($data->key() + 1).'行目の在庫数無制限フラグが設定されていません。'); |
|
1010 | 1010 | } else { |
1011 | 1011 | if ($row['在庫数無制限フラグ'] == (string) Constant::DISABLED) { |
1012 | 1012 | $ProductClass->setStockUnlimited(Constant::DISABLED); |
1013 | 1013 | // 在庫数が設定されていなければエラー |
1014 | 1014 | if ($row['在庫数'] == '') { |
1015 | - $this->addErrors(($data->key() + 1) . '行目の在庫数が設定されていません。'); |
|
1015 | + $this->addErrors(($data->key() + 1).'行目の在庫数が設定されていません。'); |
|
1016 | 1016 | } else { |
1017 | 1017 | $stock = str_replace(',', '', $row['在庫数']); |
1018 | 1018 | if (preg_match('/^\d+$/', $stock) && $stock >= 0) { |
1019 | 1019 | $ProductClass->setStock($row['在庫数']); |
1020 | 1020 | } else { |
1021 | - $this->addErrors(($data->key() + 1) . '行目の在庫数は0以上の数値を設定してください。'); |
|
1021 | + $this->addErrors(($data->key() + 1).'行目の在庫数は0以上の数値を設定してください。'); |
|
1022 | 1022 | } |
1023 | 1023 | } |
1024 | 1024 | |
@@ -1026,7 +1026,7 @@ discard block |
||
1026 | 1026 | $ProductClass->setStockUnlimited(Constant::ENABLED); |
1027 | 1027 | $ProductClass->setStock(null); |
1028 | 1028 | } else { |
1029 | - $this->addErrors(($data->key() + 1) . '行目の在庫数無制限フラグが設定されていません。'); |
|
1029 | + $this->addErrors(($data->key() + 1).'行目の在庫数無制限フラグが設定されていません。'); |
|
1030 | 1030 | } |
1031 | 1031 | } |
1032 | 1032 | |
@@ -1035,7 +1035,7 @@ discard block |
||
1035 | 1035 | if (preg_match('/^\d+$/', $saleLimit) && $saleLimit >= 0) { |
1036 | 1036 | $ProductClass->setSaleLimit($saleLimit); |
1037 | 1037 | } else { |
1038 | - $this->addErrors(($data->key() + 1) . '行目の販売制限数は0以上の数値を設定してください。'); |
|
1038 | + $this->addErrors(($data->key() + 1).'行目の販売制限数は0以上の数値を設定してください。'); |
|
1039 | 1039 | } |
1040 | 1040 | } |
1041 | 1041 | |
@@ -1044,18 +1044,18 @@ discard block |
||
1044 | 1044 | if (preg_match('/^\d+$/', $price01) && $price01 >= 0) { |
1045 | 1045 | $ProductClass->setPrice01($price01); |
1046 | 1046 | } else { |
1047 | - $this->addErrors(($data->key() + 1) . '行目の通常価格は0以上の数値を設定してください。'); |
|
1047 | + $this->addErrors(($data->key() + 1).'行目の通常価格は0以上の数値を設定してください。'); |
|
1048 | 1048 | } |
1049 | 1049 | } |
1050 | 1050 | |
1051 | 1051 | if ($row['販売価格'] == '') { |
1052 | - $this->addErrors(($data->key() + 1) . '行目の販売価格が設定されていません。'); |
|
1052 | + $this->addErrors(($data->key() + 1).'行目の販売価格が設定されていません。'); |
|
1053 | 1053 | } else { |
1054 | 1054 | $price02 = str_replace(',', '', $row['販売価格']); |
1055 | 1055 | if (preg_match('/^\d+$/', $price02) && $price02 >= 0) { |
1056 | 1056 | $ProductClass->setPrice02($price02); |
1057 | 1057 | } else { |
1058 | - $this->addErrors(($data->key() + 1) . '行目の販売価格は0以上の数値を設定してください。'); |
|
1058 | + $this->addErrors(($data->key() + 1).'行目の販売価格は0以上の数値を設定してください。'); |
|
1059 | 1059 | } |
1060 | 1060 | } |
1061 | 1061 | |
@@ -1065,7 +1065,7 @@ discard block |
||
1065 | 1065 | if ($row['商品規格削除フラグ'] == (string) Constant::DISABLED || $row['商品規格削除フラグ'] == (string) Constant::ENABLED) { |
1066 | 1066 | $ProductClass->setDelFlg($row['商品規格削除フラグ']); |
1067 | 1067 | } else { |
1068 | - $this->addErrors(($data->key() + 1) . '行目の商品規格削除フラグが設定されていません。'); |
|
1068 | + $this->addErrors(($data->key() + 1).'行目の商品規格削除フラグが設定されていません。'); |
|
1069 | 1069 | } |
1070 | 1070 | } |
1071 | 1071 |