class DatabaseRepository implements ConfigRepository

DB 에 자료를 입출력 하는 역할을 담당

Properties

protected string $table using DB table name
protected VirtualConnectionInterface $conn DB connection instance

Methods

__construct(VirtualConnectionInterface $conn)

constructor

find(string $siteKey, string $name)

search getter

array
fetchAncestor(string $siteKey, string $name)

search ancestors getter

array
fetchDescendant(string $siteKey, string $name)

search descendants getter

void
clearLike(ConfigEntity $config, array $excepts = array())

clear all just descendants vars

void
remove(string $siteKey, string $name)

remove

insert(ConfigEntity $config)

insert

update(ConfigEntity $config)

update

void
foster(ConfigEntity $config, string|null $to = null)

Parent Changing with descendant

void
affiliate(ConfigEntity $config, string|null $to = null)

affiliated to another config

createModel(array $attributes)

make new object

Details

at line 52
__construct(VirtualConnectionInterface $conn)

constructor

Parameters

VirtualConnectionInterface $conn DB connection instance

at line 65
ConfigEntity find(string $siteKey, string $name)

search getter

Parameters

string $siteKey site key
string $name the name

Return Value

ConfigEntity

at line 84
array fetchAncestor(string $siteKey, string $name)

search ancestors getter

Parameters

string $siteKey site key
string $name the name

Return Value

array

at line 107
array fetchDescendant(string $siteKey, string $name)

search descendants getter

Parameters

string $siteKey site key
string $name the name

Return Value

array

at line 129
ConfigEntity save(ConfigEntity $config)

save

Parameters

ConfigEntity $config config object

Return Value

ConfigEntity

at line 147
void clearLike(ConfigEntity $config, array $excepts = array())

clear all just descendants vars

Parameters

ConfigEntity $config config object
array $excepts target to the except

Return Value

void

at line 171
void remove(string $siteKey, string $name)

remove

Parameters

string $siteKey site key
string $name the name

Return Value

void

at line 188
protected ConfigEntity insert(ConfigEntity $config)

insert

Parameters

ConfigEntity $config config object

Return Value

ConfigEntity

at line 202
protected ConfigEntity update(ConfigEntity $config)

update

Parameters

ConfigEntity $config config object

Return Value

ConfigEntity

at line 224
void foster(ConfigEntity $config, string|null $to = null)

Parent Changing with descendant

Parameters

ConfigEntity $config config object
string|null $to to config prefix

Return Value

void

at line 252
void affiliate(ConfigEntity $config, string|null $to = null)

affiliated to another config

Parameters

ConfigEntity $config config object
string|null $to parent name

Return Value

void

at line 272
protected ConfigEntity createModel(array $attributes)

make new object

Parameters

array $attributes raw data

Return Value

ConfigEntity