diff --git a/app/Controllers/Mangboard/Crawler/MyCrawler.php b/app/Controllers/Mangboard/Crawler/MyCrawler.php index 57ca78e..cb50f91 100644 --- a/app/Controllers/Mangboard/Crawler/MyCrawler.php +++ b/app/Controllers/Mangboard/Crawler/MyCrawler.php @@ -224,7 +224,8 @@ abstract class MyCrawler extends CommonController } return $storages; } - private function backend_process(int $cnt, array $listInfo, array $storages): void + + private function create_board_process(int $cnt, array $listInfo, array $storages) { //Board DB 등록작업등 $formDatas = ['image_path' => "", 'content' => ""]; @@ -264,7 +265,12 @@ abstract class MyCrawler extends CommonController $this->getBoardModel()->getTable(), count($storages) )); - + return $board_entity; + } + private function backend_process(int $cnt, array $listInfo, array $storages): void + { + //Board 등록작업등 + $board_entity = $this->create_board_process($cnt, $listInfo, $storages); //File DB 등록작업, 작은이미지 생성 foreach ($storages as $storage) { try { @@ -288,15 +294,8 @@ abstract class MyCrawler extends CommonController $formDatas = []; $formDatas['image_path'] = ""; $formDatas['content'] = $selector->html(); - //File DB 및 Board DB 등록작업등 - $this->getBoardModel()->createByCrawler( - $this->getBoardsEntity(), - $this->getUserEntity(), - $cnt, - $listInfo, - [], - $formDatas - ); + //Board 등록작업등 + $board_entity = $this->create_board_process($cnt, $listInfo, []); log_message("notice", __FUNCTION__ . " 작업이 완료되었습니다."); return $listInfo; }