Automation init...3

This commit is contained in:
최준흠 2024-09-13 11:39:42 +09:00
parent 916f466de4
commit cb636881f0

View File

@ -93,16 +93,17 @@ class YamapLibrary extends MyCrawlerLibrary
private function modifyBoard(BoardEntity $entity)
{
$content = implode("\n", $this->_media_tags["content"]);
if ($content == "") {
if ($content !== "") {
$formDatas = [
"image_path" => array_shift($this->_media_tags["image_path"]),
"content" => $content
];
$this->getBoardModel()->modify($entity, $formDatas);
log_message("notice", __FUNCTION__ . " 작업 완료");
} else {
$this->getBoardModel()->delete([$this->getBoardModel()->getFieldPK() => $entity->getPK()]);
log_message(level: "warning", message: __FUNCTION__ . "내용이 없어 삭제처리 : {$entity->getPK()}=>{$entity->getTitle()}");
}
$formDatas = [
"image_path" => array_shift($this->_media_tags["image_path"]),
"content" => $content
];
$this->getBoardModel()->modify($entity, $formDatas);
log_message("notice", __FUNCTION__ . " 작업 완료");
}
private function mainPage(string $url): array