Subversion Repositories oidplus

Rev

Rev 1086 | Rev 1148 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1086 Rev 1116
Line 23... Line 23...
23
\defined('INSIDE_OIDPLUS') or die;
23
\defined('INSIDE_OIDPLUS') or die;
24
// phpcs:enable PSR1.Files.SideEffects
24
// phpcs:enable PSR1.Files.SideEffects
25
 
25
 
26
abstract class OIDplusSqlSlangPlugin extends OIDplusPlugin {
26
abstract class OIDplusSqlSlangPlugin extends OIDplusPlugin {
27
 
27
 
-
 
28
        /**
-
 
29
         * @return string
-
 
30
         */
28
        public abstract static function id(): string;
31
        public abstract static function id(): string;
29
 
32
 
-
 
33
        /**
-
 
34
         * @param string $fieldname
-
 
35
         * @param string $order
-
 
36
         * @return string
-
 
37
         */
30
        public abstract function natOrder($fieldname, $order='asc'): string;
38
        public abstract function natOrder(string $fieldname, string $order='asc'): string;
31
 
39
 
-
 
40
        /**
-
 
41
         * @return string
-
 
42
         */
32
        public abstract function sqlDate(): string;
43
        public abstract function sqlDate(): string;
33
 
44
 
-
 
45
        /**
-
 
46
         * @param OIDplusDatabaseConnection $db
-
 
47
         * @return bool
-
 
48
         */
34
        public abstract function detect(OIDplusDatabaseConnection $db): bool;
49
        public abstract function detect(OIDplusDatabaseConnection $db): bool;
35
 
50
 
-
 
51
        /**
36
        // Please note: This insert_id() function should use SQL to receive
52
         * Please note: This insert_id() function should use SQL to receive
37
        // the last inserted ID. If the database connection provider (e.g. PDO)
53
         * the last inserted ID. If the database connection provider (e.g. PDO)
38
        // offers a way to fetch the last inserted ID, please use this instead!
54
         * offers a way to fetch the last inserted ID, please use this instead!
39
        // So, please do NOT use  OIDplus::db()->getSlang()->insert_id()
55
         * So, please do NOT use  OIDplus::db()->getSlang()->insert_id()
40
        // but instead use        OIDplus::db()->insert_id()
56
         * but instead use        OIDplus::db()->insert_id()
41
        // This way, the database connection provider can override that function
57
         * This way, the database connection provider can override that function
42
        // with their own method of fetching the last inserted ID.
58
         * with their own method of fetching the last inserted ID.
-
 
59
         * @param OIDplusDatabaseConnection $db
-
 
60
         * @return int 0 on failure.
-
 
61
         */
43
        public abstract function insert_id(OIDplusDatabaseConnection $db): int;
62
        public abstract function insert_id(OIDplusDatabaseConnection $db): int;
44
 
63
 
-
 
64
        /**
-
 
65
         * @param string $cont
-
 
66
         * @param string $table
-
 
67
         * @param string $prefix
-
 
68
         * @return string
-
 
69
         */
45
        public abstract function setupSetTablePrefix($cont, $table, $prefix): string;
70
        public abstract function setupSetTablePrefix(string $cont, string $table, string $prefix): string;
46
 
71
 
-
 
72
        /**
-
 
73
         * @param string $database
-
 
74
         * @return string
-
 
75
         */
47
        public abstract function setupCreateDbIfNotExists($database): string;
76
        public abstract function setupCreateDbIfNotExists(string $database): string;
48
 
77
 
-
 
78
        /**
-
 
79
         * @param string $database
-
 
80
         * @return string
-
 
81
         */
49
        public abstract function setupUseDatabase($database): string;
82
        public abstract function setupUseDatabase(string $database): string;
-
 
83
 
-
 
84
        /**
-
 
85
         * @param string $sql
-
 
86
         * @return string
-
 
87
         */
-
 
88
        public abstract function filterQuery(string $sql): string;
50
 
89
 
-
 
90
        /**
-
 
91
         * @param bool $bool
-
 
92
         * @return string
-
 
93
         */
51
        public abstract function filterQuery($sql): string;
94
        public abstract function getSQLBool(bool $bool): string;
52
 
95
 
-
 
96
        /**
-
 
97
         * @param string $str
-
 
98
         * @return string
-
 
99
         */
53
        public abstract function getSQLBool($bool): string;
100
        public abstract function escapeString(string $str): string;
54
 
101
 
-
 
102
        /**
-
 
103
         * @param string $expr1
-
 
104
         * @param string $expr2
-
 
105
         * @return string
-
 
106
         */
55
        public abstract function escapeString($str): string;
107
        public abstract function isNullFunction(string $expr1, string $expr2): string;
56
 
108
 
57
}
109
}