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