- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
public function insert(array $data)
{
$hstoreData = array();
if (isset($data['description'])) {
$hstoreData['description'] = $data['description'];
unset($data['description']);
}
if (isset($data['developer'])) {
$hstoreData['developer'] = $data['developer'];
unset($data['developer']);
}
if (isset($data['localizer'])) {
$hstoreData['localizer'] = $data['localizer'];
unset($data['localizer']);
}
if (isset($data['gameplay_video'])) {
$hstoreData['gameplay_video'] = $data['gameplay_video'];
unset($data['gameplay_video']);
}
if (isset($data['news_community_id'])) {
$hstoreData['news_community_id'] = $data['news_community_id'];
unset($data['news_community_id']);
}
if (isset($data['bg_color'])) {
$hstoreData['bg_color'] = $data['bg_color'];
unset($data['bg_color']);
}
if (isset($data['bg_image'])) {
$hstoreData['bg_image'] = $data['bg_image'];
unset($data['bg_image']);
}
if (isset($data['bg_link'])) {
$hstoreData['bg_link'] = $data['bg_link'];
unset($data['bg_link']);
}
$result = parent::insert($data);
$this->updateByID($result, $hstoreData);
return $result;
}
vistefan 13.03.2018 17:55 # 0
g0_1494076596974 13.03.2018 18:10 # +4
fuckercoder 27.03.2018 05:31 # 0
roman-kashitsyn 14.03.2018 00:23 # −1
постгресик?
> $result = parent::insert($data);
> $this->updateByID($result, $hstoreData);
Похоже на какое-то прототипное наследование. Сначала апдейтим прототип, потом себя.
fuckercoder 27.03.2018 05:31 # 0
bormand 14.03.2018 06:54 # 0
fuckercoder 27.03.2018 05:32 # 0
fuckercoder 27.03.2018 05:30 # 0