PHP 클래스 Craft\ImportService

Contains common import logic
저자: Bob Olde Hampsink ([email protected])
상속: extends craft\BaseApplicationComponent
파일 보기 프로젝트 열기: boboldehampsink/import 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$customOptionPaths array Custom
$log array Save log.

공개 메소드들

메소드 설명
columns ( string $file ) : array Read CSV columns.
data ( string $file ) : array Get CSV data.
debug ( array | object $settings, integer $history, integer $step )
finish ( array $settings, string $backup ) Finish importing.
getCustomOption ( string $fieldHandle ) : string Get path to fieldtype's custom
getService ( stirng $elementType ) : craft\IImportElementType | boolean Get service to use for importing.
onBeforeImportDelete ( craft\Event $event )
onImportFinish ( craft\Event $event )
onImportStart ( craft\Event $event )
prepForFieldType ( &$data, string $handle ) : mixed Prepare fields for fieldtypes.
row ( integer $row, array $data, array | object $settings ) Import row.
slugify ( string $slug ) : string Function that (almost) mimics Craft's inner slugify process.

보호된 메소드들

메소드 설명
_open ( string $file ) : array Special function that handles csv delimiter detection.
getNewTagModel ( ) : craft\TagModel
saveBackup ( array $settings, string $backup, craft\UserModel $currentUser ) : string

비공개 메소드들

메소드 설명
prepAssetsFieldType ( string $data, craft\FieldModel $field ) : array
prepCategoriesFieldType ( string $data, craft\FieldModel $field ) : array
prepDropDownFieldType ( mixed $data, craft\FieldModel $field ) : mixed
prepEntriesFieldType ( string $data, craft\FieldModel $field ) : array
prepTagsFieldType ( string $data, craft\FieldModel $field ) : array
prepUsersFieldType ( string $data, craft\FieldModel $field ) : array
replaceOrDelete ( integer $row, array &$settings, craft\IImportElementType $service, array $fields ) : null | craft\BaseElementModel

메소드 상세

_open() 보호된 메소드

Special function that handles csv delimiter detection.
protected _open ( string $file ) : array
$file string
리턴 array

columns() 공개 메소드

Read CSV columns.
public columns ( string $file ) : array
$file string
리턴 array

data() 공개 메소드

Get CSV data.
public data ( string $file ) : array
$file string
리턴 array

debug() 공개 메소드

public debug ( array | object $settings, integer $history, integer $step )
$settings array | object
$history integer
$step integer

finish() 공개 메소드

Finish importing.
public finish ( array $settings, string $backup )
$settings array
$backup string

getCustomOption() 공개 메소드

Get path to fieldtype's custom
public getCustomOption ( string $fieldHandle ) : string
$fieldHandle string
리턴 string

getNewTagModel() 보호된 메소드

protected getNewTagModel ( ) : craft\TagModel
리턴 craft\TagModel

getService() 공개 메소드

Get service to use for importing.
public getService ( stirng $elementType ) : craft\IImportElementType | boolean
$elementType stirng
리턴 craft\IImportElementType | boolean

onBeforeImportDelete() 공개 메소드

public onBeforeImportDelete ( craft\Event $event )
$event craft\Event

onImportFinish() 공개 메소드

public onImportFinish ( craft\Event $event )
$event craft\Event

onImportStart() 공개 메소드

public onImportStart ( craft\Event $event )
$event craft\Event

prepForFieldType() 공개 메소드

Prepare fields for fieldtypes.
public prepForFieldType ( &$data, string $handle ) : mixed
$handle string
리턴 mixed

row() 공개 메소드

Import row.
public row ( integer $row, array $data, array | object $settings )
$row integer
$data array
$settings array | object

saveBackup() 보호된 메소드

protected saveBackup ( array $settings, string $backup, craft\UserModel $currentUser ) : string
$settings array
$backup string
$currentUser craft\UserModel
리턴 string Backup filename

slugify() 공개 메소드

But... we allow forward slashes to stay, so we can create full uri's.
public slugify ( string $slug ) : string
$slug string
리턴 string

프로퍼티 상세

$customOptionPaths 공개적으로 프로퍼티

Custom
public array $customOptionPaths
리턴 array

$log 공개적으로 프로퍼티

Save log.
public array $log
리턴 array