트리거 | 호출시점 | 설명 |
---|---|---|
copyDocumentModule.each | before, after | |
copyDocumentModule | before, add, after | |
declaredDocument | before, after | |
declaredDocumentCancel | before, after | |
deleteDocument | before, after | |
getComments | after | |
getDocumentList | before, after | |
getDocumentMenu | before, after | |
getNoticeList | before, after | |
getThumbnail | before | |
insertDocument | before, after | |
manage | before, after | |
moveDocumentModule | before, after | |
moveDocumentToTrash | before, after | |
publishDocument | before, after | |
restoreTrash | after | |
updateDocument | before, after | |
updateReadedCount | before, after | |
updateVotedCount | before, after | |
updateVotedCountCancel | before, after |
글 조회 🚧 초안 작성중
getDocumentList 🚧 초안 작성중
getNoticeList 🚧 초안 작성중
글 추가, 수정, 삭제 🚧 초안 작성중
insertDocument 🚧 초안 작성중
WARNING
이 이벤트는 글과 관련된 데이터의 변경사항을 처리하는 트랜잭션 안에서 동작하므로 의도하지 않은 롤백이 발생하지 않도록 주의해야 한다.
after
php
/**
* @see \DocumentController::insertDocument()
* @param object{
* '_filter': string,
* 'act': string,
* 'allow_trackback': 'Y'|'N',
* 'category_srl': int,
* 'comment_status': "ALLOW",
* 'commentStatus': "ALLOW",
* 'content': string, // 글 내용
* 'document_srl': int, // 글 번호
* 'email_address': string,
* 'error_return_url':string,
* 'extra_vars': string,
* 'homepage': string,
* 'ipaddress': string,
* 'is_admin': 'Y'|'N',
* 'is_notice': 'Y'|'N', // 공지사항
* 'isRestore': bool, // 복구 기능으로 복원처리이면 true
* 'lang_code': string,
* 'list_order': int,
* 'member_srl': int, // 회원
* 'mid': string,
* 'module_srl': int,
* 'module': string,
* 'nick_name': string,
* 'notify_message': 'Y'|'N',
* 'readed_count': int,
* 'status': string, // 글 발행 등의 상태
* 'tags': string,
* 'title': string, // 제목
* 'update_order': int,
* 'updated_file_count': int,
* 'uploaded_count': int,
* 'use_editor': 'Y'|'N',
* 'use_html': 'Y'|'N',
* 'user_id': string,
* 'user_name': string,
* } $data
*/
status
값에 따른 구분- TEMP : 임시저장
- PRIVATE
- PUBLIC : 공개
- SECRET : 비밀글
- EMBARGO
- TRASH : 휴지통
- CENSORED
- CENSORED_BY_ADMIN
- DELETED
- DELETED_BY_ADMIN
- OTHER
updateDocument 🚧 초안 작성중
php
/**
* @see \DocumentController::updateDocument()
*/
updateReadedCount 🚧 초안 작성중
php
/**
* @see \DocumentController::updateReadedCount()
*/
deleteDocument 🚧 초안 작성중
php
/**
* @see \DocumentController::deleteDocument()
*/
before
after
php
/**
* 'document_srl': int,
* 'module_srl': int,
* 'category_srl': int,
* 'lang_code': string,
* 'is_notice': "N",
* 'title': string,
* 'title_bold': "N",
* 'title_color': "N",
* 'content': string,
* 'readed_count': int,
* 'voted_count': int,
* 'blamed_count': int,
* 'comment_count': int,
* 'trackback_count': int,
* 'uploaded_count': int,
* 'password': null,
* 'user_id': string,
* 'user_name': string,
* 'nick_name': string,
* 'member_srl': int,
* 'email_address': string,
* 'homepage': string,
* 'tags': null,
* 'extra_vars': string,
* 'regdate': string,
* 'last_update': string,
* 'last_updater': null,
* 'ipaddress': string,
* 'list_order': int,
* 'update_order': int,
* 'allow_trackback': "N",
* 'notify_message': "N",
* 'status': "PUBLIC",
* 'comment_status': "ALLOW",
* 'apparent_module_srl': int,
* 'origin_module_srl': int,
* // 휴지통 비우기로 삭제하는 경우 true
* 'isEmptyTrash': bool,
*/
publishDocument Since v2.1.12 🚧 초안 작성중
php
/**
* @see \DocumentController::insertDocument()
* @see \DocumentController::updateDocument()
*/
휴지통 🚧 초안 작성중
moveDocumentToTrash 🚧 초안 작성중
restoreTrash 🚧 초안 작성중
복사, 이동 🚧 초안 작성중
moveDocumentModule 🚧 초안 작성중
copyDocumentModule 🚧 초안 작성중
copyDocumentModule.each 🚧 초안 작성중
신고 🚧 초안 작성중
declaredDocument 🚧 초안 작성중
declaredDocumentCancel 🚧 초안 작성중
댓글 🚧 초안 작성중
getComments 🚧 초안 작성중
기타 🚧 초안 작성중
getDocumentMenu 🚧 초안 작성중
getThumbnail 🚧 초안 작성중
manage 🚧 초안 작성중
updateVotedCount - 추천/비추천 before | after 🚧 초안 작성중
글을 추천하거나 비추천할 때 발생하는 이벤트이다. 추천/비추천을 받은 회원 번호와 글 번호를 받을 수 있다.
php
/**
* @see \DocumentController::updateVotedCount()
* @param object{
* // 추천/비추천을 받는 대상 회원번호(글쓴이)
* member_srl: int,
* // 대상 모듈번호
* module_srl: int,
* // 대상 문서번호
* document_srl: int,
* // 추천|비추천
* update_target: 'voted_count'|'blamed_count',
* // 부여 포인트. 보통 `1`이다
* point: int,
* // 변경 전 추천/비추천 수
* before_point: int,
* // 변경 후 추천/비추천 수. before_point + point
* after_point: int,
* // 취소 여부
* cancel: bool,
* } $data
*/
function($data) {
$message = '';
if ($data->update_target === 'voted_count') {
// 추천: voted_count
$message = $data->cancel ? '추천 취소' : '추천';
} else if ($data->update_target === 'blamed_count') {
// 비추천: blamed_count
$message = $data->cancel ? '비추천 취소' : '비추천';
}
debugPrint("{$data->member_srl} 글쓴이의 {$data->document_srl} 글이 {$message} 되었습니다");
}
updateVotedCountCancel - 추천/비추천 취소 before | after 🚧 초안 작성중
같은 형식의 데이터
이 이벤트와 앞의 document.updateVotedCount
이벤트는 데이터 형식이 같다.
위 예제와 같은 이벤트 리스너에서 cancel
속성으로 구분하여 함께 처리할 수 있다.
php
/**
* @see \DocumentController::updateVotedCountCancel()
*/