class PluginCollection implements Countable, Arrayable, IteratorAggregate, Jsonable

설치된 플러그인들의 정보를 저장하는 저장소

Properties

protected PluginEntity[] $plugins
protected array $statusList
protected PluginScanner $scanner
protected PluginCache $cache
protected String $entityClass

Methods

__construct(PluginScanner $pluginScanner, PluginCache $pluginCache, string $entityClass, array $pluginStatus = array())

Constructor

void
initialize(bool $refresh = false)

설치된 플러그인들의 정보를 초기화 한다. 만약 cache에 저장된 정보가 있을 경우 cache로부터 저장된 정보를 가져오며, 캐싱된 정보가 없거나 refresh가 설정돼 있을 경우 다시 플러그인 디렉토리를 스캔하여 정보를 생성한다.

void
refresh()

플러그인 디렉토리를 스캔하여 플러그인 정보를 새로 갱신한다.

get(string $id)

주어진 id의 플러그인을 반환한다.

getList(array $ids = null)

주어진 id에 해당하는 플러그인 목록을 조회한다.

fetch(array $searchField)

주어진 검색 정보 사용하여 플러그인을 조회한다.

fetchByStatus(string $status, PluginEntity[] $plugins = null)

플러그인 상태로 플러그인 목록을 조회한다.

fetchByKeyword(string $searchWord, PluginEntity[] $plugins = null)

키워드로 플러그인 목록을 조회한다. 주어진 키워드를 id, description, keywords, author정보에서 조회한다.

fetchByComponent(string $component, PluginEntity[] $plugins = null)

주어진 컴포넌트 타입을 소유한 플러그인 목록을 조회한다.

bool
has(string $id)

주어진 아이디를 가진 플러그인이 있는지 조사한다.

string
toJson(int $options)

Convert the object to its JSON representation.

int
count()

설치된 플러그인의 갯수를 반환한다.

getIterator()

Retrieve an external iterator

array
toArray()

Get the instance as an array.

resolvePlugins(array $pluginData)

주어진 플러그인 정보를 사용하여 PluginEntity 목록을 생성후 반환한다.

Details

at line 71
__construct(PluginScanner $pluginScanner, PluginCache $pluginCache, string $entityClass, array $pluginStatus = array())

Constructor

Parameters

PluginScanner $pluginScanner Plugin Scanner
PluginCache $pluginCache Plugin Cache
string $entityClass PluginEntity class name
array $pluginStatus plugin status info list

at line 98
void initialize(bool $refresh = false)

설치된 플러그인들의 정보를 초기화 한다. 만약 cache에 저장된 정보가 있을 경우 cache로부터 저장된 정보를 가져오며, 캐싱된 정보가 없거나 refresh가 설정돼 있을 경우 다시 플러그인 디렉토리를 스캔하여 정보를 생성한다.

Parameters

bool $refresh true일 경우, 캐싱된 데이터를 삭제하고 플러그인 정보를 새로 생성한다.

Return Value

void

at line 123
protected void refresh()

플러그인 디렉토리를 스캔하여 플러그인 정보를 새로 갱신한다.

Return Value

void

at line 137
PluginEntity get(string $id)

주어진 id의 플러그인을 반환한다.

Parameters

string $id 플러그인 아이디

Return Value

PluginEntity

at line 149
PluginEntity[] getList(array $ids = null)

주어진 id에 해당하는 플러그인 목록을 조회한다.

Parameters

array $ids 플러그인 아이디 목록

Return Value

PluginEntity[]

at line 165
PluginEntity[] fetch(array $searchField)

주어진 검색 정보 사용하여 플러그인을 조회한다.

status, keyword, 소유한 component를 검색 필드로 사용할 수 있다.

Parameters

array $searchField 검색 정보

Return Value

PluginEntity[]

at line 196
PluginEntity[] fetchByStatus(string $status, PluginEntity[] $plugins = null)

플러그인 상태로 플러그인 목록을 조회한다.

만약 두번째 파라메터에 플러그인 목록이 주어진다면, 주어진 플러그인 목록이 조회대상이 된다.

Parameters

string $status 플러그인 상태
PluginEntity[] $plugins 조회대상 플러그인 목록

Return Value

PluginEntity[]

at line 221
PluginEntity[] fetchByKeyword(string $searchWord, PluginEntity[] $plugins = null)

키워드로 플러그인 목록을 조회한다. 주어진 키워드를 id, description, keywords, author정보에서 조회한다.

만약 두번째 파라메터에 플러그인 목록이 주어진다면, 주어진 플러그인 목록이 조회대상이 된다.

Parameters

string $searchWord 검색할 키워드
PluginEntity[] $plugins 조회대상 플러그인 목록

Return Value

PluginEntity[]

at line 262
PluginEntity[] fetchByComponent(string $component, PluginEntity[] $plugins = null)

주어진 컴포넌트 타입을 소유한 플러그인 목록을 조회한다.

만약 두번째 파라메터에 플러그인 목록이 주어진다면, 주어진 플러그인 목록이 조회대상이 된다.

Parameters

string $component 조회할 컴포넌트 타입
PluginEntity[] $plugins 조회대상 플러그인 목록

Return Value

PluginEntity[]

at line 288
bool has(string $id)

주어진 아이디를 가진 플러그인이 있는지 조사한다.

Parameters

string $id plugin id

Return Value

bool

at line 300
string toJson(int $options)

Convert the object to its JSON representation.

Parameters

int $options json_encode option

Return Value

string

at line 310
int count()

설치된 플러그인의 갯수를 반환한다.

Return Value

int

at line 320
Traversable getIterator()

Retrieve an external iterator

Return Value

Traversable An instance of an object implementing Iterator Traversable

at line 330
array toArray()

Get the instance as an array.

Return Value

array

at line 348
protected PluginEntity[] resolvePlugins(array $pluginData)

주어진 플러그인 정보를 사용하여 PluginEntity 목록을 생성후 반환한다.

Parameters

array $pluginData 플러그인 정보

Return Value

PluginEntity[]