PHP Class Xpressengine\Draft\DraftHandler

### app binding : xe.draft 로 바인딩 되어 있음 XeDraft Facade 로 접근이 가능 ### Usage 임시저장될 데이터는 key, value 형태로 등록되어집니다. 이때 key 는 구분할 수 있는 문자열으로, 중복이 가능합니다. 등록되어질 내용이 value 이외에 추가적으로 더 있을 경우 배열로 함께 전달해야 합니다. php XeDraft::set('key string', 'it is test content', ['foo' => 'bar', 'baz' => 'qux']); 임시저장된 데이터를 가져올때는 등록시 사용했던 key 를 통해서 같은 키를 가지는 데이터 목록을 반환 받을 수 도 있고, 등록시 생성된 id 를 통해 한개의 데이터만 반환 받을 수 도 있습니다. php list $dataList = XeDraft::get('key string'); one $data = XeDraft::getById('id');
Author: XE Developers ([email protected])
Show file Open project: xpressengine/xpressengine Class Usage Examples

Protected Properties

Property Type Description
$auth Illuminate\Auth\AuthManager AuthManager instance
$repo DraftRepository Repository instance

Public Methods

Method Description
__construct ( DraftRepository $repo, Illuminate\Auth\AuthManager $auth ) Constructor
exists ( string $key ) : boolean 키 값에 해당하는 임시저장 데이터 존재 유무 판별
get ( string $key ) : DraftEntity[] 임시저장 데이터들을 반환 함
getAuto ( string $key ) : DraftEntity 자동저장으로 저장된 데이터 반환
getById ( string $id ) : DraftEntity 아이디에 해당 하는 데이터 반환
put ( string $id, string $val, array $etc = [] ) : DraftEntity 임시저장 데이터 갱신
remove ( DraftEntity $draft ) : void 임시저장 데이터 삭제
set ( string $key, mixed $val, array $etc = [], boolean $isAuto = false ) : DraftEntity 임시 데이터 저장

Method Details

__construct() public method

Constructor
public __construct ( DraftRepository $repo, Illuminate\Auth\AuthManager $auth )
$repo DraftRepository Repository instance
$auth Illuminate\Auth\AuthManager AuthManager instance

exists() public method

키 값에 해당하는 임시저장 데이터 존재 유무 판별
public exists ( string $key ) : boolean
$key string 구분할 수 있는 키(중복가능)
return boolean

get() public method

임시저장 데이터들을 반환 함
public get ( string $key ) : DraftEntity[]
$key string 구분할 수 있는 키(중복가능)
return DraftEntity[]

getAuto() public method

자동저장으로 저장된 데이터 반환
public getAuto ( string $key ) : DraftEntity
$key string 구분할 수 있는 키
return DraftEntity

getById() public method

아이디에 해당 하는 데이터 반환
public getById ( string $id ) : DraftEntity
$id string 임시저장 아이디
return DraftEntity

put() public method

임시저장 데이터 갱신
public put ( string $id, string $val, array $etc = [] ) : DraftEntity
$id string 임시저장 아이디
$val string 갱신될 data 값
$etc array 기타 값들
return DraftEntity

remove() public method

임시저장 데이터 삭제
public remove ( DraftEntity $draft ) : void
$draft DraftEntity 임시저장 객체
return void

set() public method

임시 데이터 저장
public set ( string $key, mixed $val, array $etc = [], boolean $isAuto = false ) : DraftEntity
$key string 구분할 수 있는 키(중복가능)
$val mixed 저장될 내용
$etc array 기타 값들
$isAuto boolean 자동 저장 인지 여부
return DraftEntity

Property Details

$auth protected property

AuthManager instance
protected AuthManager,Illuminate\Auth $auth
return Illuminate\Auth\AuthManager

$repo protected property

Repository instance
protected DraftRepository,Xpressengine\Draft $repo
return DraftRepository