Completed
Push — development ( ef9e73...b2c3e4 )
by Andrij
20:27
created

Found_less_expensive_model::getModuleSettings()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 2
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 9.4285
1
<?php
2
3
class Found_less_expensive_model extends CI_Model
4
{
0 ignored issues
show
introduced by
Opening brace of a class must be on the same line as the definition
Loading history...
5
6
    public function __construct() {
7
8
        parent::__construct();
9
    }
10
11
    /**
12
     * Get
13
     * @param integer $row_count
14
     * @param integer $offset
15
     * @param integer $status
16
     * @return array
17
     */
18
    public function allByStatus($row_count, $offset, $status) {
19
20
        $this->db->order_by('date', 'desc');
21
        if ($row_count > 0 AND $offset >= 0) {
22
            $query = $this->db->where_in('status', $status)->get('mod_found_less_expensive', $row_count, $offset)->result_array();
23
        } else {
24
            $query = $this->db->where_in('status', $status)->get('mod_found_less_expensive')->result_array();
25
        }
26
27
        return $query;
28
    }
29
30
    /**
31
     * Get count of all messages about found less expensive
32
     * @param array $status
33
     * @return integer
34
     */
35
    public function getCountAll($status) {
36
37
        $res = $this->db->where_in('status', $status)->get('mod_found_less_expensive')->result_array();
38
        return count($res);
39
    }
40
41
    /**
42
     * @return array
0 ignored issues
show
Documentation introduced by
Consider making the return type a bit more specific; maybe use array<string,integer|string>.

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
43
     */
44
    public function getEmailPatterns() {
45
46
        $data = [
47
                 'id'                   => 10,
48
                 'name'                 => 'Found_less_expensive',
49
                 'type'                 => 'HTML',
50
                 'user_message_active'  => 1,
51
                 'admin_message_active' => 1,
52
                ];
53
54
        return $data;
55
56
    }
57
58
    /**
59
     * @return  array $data
0 ignored issues
show
Documentation introduced by
Consider making the return type a bit more specific; maybe use array<string,integer|string>.

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
60
     */
61 View Code Duplication
    public function getEmailPatternsI18n() {
62
63
        $data = [
64
                 'id'            => 10,
65
                 'locale'        => 'ru',
66
                 'user_message'  => '<p style=\"font-family: arial; font-size: 13px; margin-top: 10px;\">Здравствуйте, $userName$!</p>\n<p style="font-family: arial; font-size: 13px; margin-top: 10px;">Вы отправили заявку, что нашли товар дешевле  , по товару $productUrl </p>\n<p style="font-family: arial; font-size: 13px; margin-top: 10px;">Ваша заявка будет рассмотрена и обработана..</p>\n<p style="font-family: arial; font-size: 13px; margin-top: 10px;">Спасибо что пользуетесь нашим сервисом.</p>',
67
                 'admin_message' => '<p style="font-family: arial; font-size: 13px; margin-top: 10px;">Пользователь <span>$userName$ создал заявку на "Нашли дешевле" </p>\n<p style="font-family: arial; font-size: 13px; margin-top: 10px;">На товаре  $productUrl</p>\n<p style="font-family: arial; font-size: 13px; margin-top: 10px;">Ссылка предоставляемая пользователем  $userLink</p>\n<p style="font-family: arial; font-size: 13px; margin-top: 10px;">Комментарий пользователя $userMessage </p>\n<p style="font-family: arial; font-size: 13px; margin-top: 10px;">Email пользователя $userEmail, Телефон пользователя $userPhone</p>\n<p style="font-family: arial; font-size: 13px; margin-top: 10px;">Дата $date</p>',
68
                 'description'   => '<p><span>Уведомление о модуле нашли дешевле</span></p>',
69
                 'variables'     => 'a:7:{s:10:"$userName$";s:31:"Имя пользователя";s:11:"$userEmail$";s:30:"Email пользователя";s:11:"$userPhone$";s:39:"Телефон пользователя";s:10:"$userLink$";s:70:"Ссылка предоставляемая пользователем";s:13:"$userMessage$";s:22:"Комментарий";s:6:"$date$";s:8:"Дата";s:12:"$productUrl$";s:33:"Страница продукта";}',
70
                ];
71
72
        return $data;
73
    }
74
75
}