Automation init...3
This commit is contained in:
parent
cb34143e90
commit
8423908a5f
@ -92,11 +92,17 @@ class YamapLibrary extends MyCrawlerLibrary
|
|||||||
}
|
}
|
||||||
private function modifyBoard(BoardEntity $entity)
|
private function modifyBoard(BoardEntity $entity)
|
||||||
{
|
{
|
||||||
$formDatas = [
|
$image_path = array_shift($this->_media_tags["image_path"]);
|
||||||
"image_path" => array_shift($this->_media_tags["image_path"]),
|
if ($image_path === null) {
|
||||||
"content" => implode("\n", $this->_media_tags["content"])
|
$this->getBoardModel()->delete([$this->getBoardModel()->getFieldPK() => $entity->getPK()]);
|
||||||
];
|
log_message("notice", __FUNCTION__ . " 내용이 없어서 삭제처리");
|
||||||
$this->getBoardModel()->modify($entity, $formDatas);
|
} else {
|
||||||
|
$formDatas = [
|
||||||
|
"image_path" => $image_path,
|
||||||
|
"content" => implode("\n", $this->_media_tags["content"]),
|
||||||
|
];
|
||||||
|
$this->getBoardModel()->modify($entity, $formDatas);
|
||||||
|
}
|
||||||
log_message("notice", __FUNCTION__ . " 작업 완료");
|
log_message("notice", __FUNCTION__ . " 작업 완료");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,8 +169,10 @@ class YamapLibrary extends MyCrawlerLibrary
|
|||||||
__FUNCTION__,
|
__FUNCTION__,
|
||||||
$content
|
$content
|
||||||
));
|
));
|
||||||
$this->_media_tags["image_path"][] = sprintf("%s/%s", $this->getMyStorage()->getPath(), $this->getMyStorage()->getOriginName());
|
if ($content === "") {
|
||||||
$this->_media_tags["content"][] = $content;
|
$this->_media_tags["image_path"][] = sprintf("%s/%s", $this->getMyStorage()->getPath(), $this->getMyStorage()->getOriginName());
|
||||||
|
$this->_media_tags["content"][] = $content;
|
||||||
|
}
|
||||||
return $myStorageLibrary;
|
return $myStorageLibrary;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -173,6 +173,11 @@ abstract class CommonModel extends Model
|
|||||||
case "content":
|
case "content":
|
||||||
$value = htmlentities($formDatas[$field], ENT_QUOTES);
|
$value = htmlentities($formDatas[$field], ENT_QUOTES);
|
||||||
break;
|
break;
|
||||||
|
case "updated_at":
|
||||||
|
case "created_at":
|
||||||
|
case "deleted_at":
|
||||||
|
$rules[$field] = "if_exist|valid_date";
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
$value = $formDatas[$field];
|
$value = $formDatas[$field];
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -143,7 +143,6 @@ class BoardModel extends CommonModel
|
|||||||
//입력후 PID값을 GID값에 넣어주기 위함
|
//입력후 PID값을 GID값에 넣어주기 위함
|
||||||
return $this->modify($entity, ['gid' => intval($entity->getPK())]);
|
return $this->modify($entity, ['gid' => intval($entity->getPK())]);
|
||||||
}
|
}
|
||||||
|
|
||||||
//modify용
|
//modify용
|
||||||
public function modify(BoardEntity $entity, array $formDatas): BoardEntity
|
public function modify(BoardEntity $entity, array $formDatas): BoardEntity
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user