1. PHP / Говнокод #23919

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 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 Марта 2018

    Комментарии (8) RSS

    Добавить комментарий