MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
mdatabaseexception.class
Ir para a documentação deste ficheiro.
1
<?php
2
31
class
MDatabaseException
extends
Exception
32
{
38
private
$sqlError;
39
40
const
UNKNOWN_ERROR_CODE
= 0;
41
const
KNOWN_ERROR_CODE
= 1;
// Error code for treated messages
42
49
public
function
generateMessage
($svnInfo =
''
)
50
{
51
$MIOLO
=
MIOLO::getInstance
();
52
switch
( $this->code )
53
{
54
case
self::KNOWN_ERROR_CODE
:
55
56
$message = ucfirst($this->getMessage());
57
58
// exibe o trace de codigo
59
if
(
MUtil::getBooleanValue
(
$MIOLO
->getConf(
'options.backtrace'
)) )
60
{
61
$trace = $this->getTrace();
62
$query = $trace[3][
'args'
][0];
63
64
$message .=
'<br /><br />'
. _M(
'Query'
) .
": $query"
.
'<br /><br />'
;
65
// $message .= str_replace("\n", '<br />', $svnInfo);
66
67
if
( strlen($this->
getSqlError
()) > 0 )
68
{
69
$message .= $this->
getSqlError
() .
'<br /><br />'
;
70
}
71
72
$message .=
MForm::expansibleText
(_M(
'Exibir trace'
), _M(
'Ocultar trace'
), $this->getTraceAsString());
73
}
74
75
break
;
76
77
78
case
self::UNKNOWN_ERROR_CODE
:
79
default
:
80
81
$message = _M(
'Database error occurred'
) .
'<br /><br />'
;
82
$message .= str_replace(
"\n"
,
'<br />'
, ucfirst($this->getMessage()));
83
84
if
(
MUtil::getBooleanValue
(
$MIOLO
->getConf(
'options.backtrace'
)) )
85
{
86
$trace = $this->getTrace();
87
$query = $trace[3][
'args'
][0];
88
89
$message .=
'<br /><br />'
. _M(
'Query'
) .
": $query"
.
'<br /><br />'
;
90
$message .= str_replace(
"\n"
,
'<br />'
, $this->getTraceAsString()) .
'<br /><br />'
;
91
$message .= str_replace(
"\n"
,
'<br />'
, $svnInfo);
92
}
93
}
94
95
return
$message;
96
}
97
103
public
function
__toString
()
104
{
105
$MIOLO
=
MIOLO::getInstance
();
106
107
$trace = $this->getTrace();
108
$query = $trace[3][
'args'
][0];
109
110
$message = ucfirst($this->getMessage());
111
$message .=
"\n\n"
. _M(
'Query'
) .
": $query"
;
112
113
if
(
MUtil::getBooleanValue
(
$MIOLO
->getConf(
'options.backtrace'
)) )
114
{
115
$message .=
"\n\n"
. $this->getTraceAsString();
116
}
117
118
return
$message;
119
}
120
121
public
function
getSqlError
() {
122
return
$this->sqlError;
123
}
124
125
public
function
setSqlError
($sqlError) {
126
$this->sqlError = $sqlError;
127
}
128
}
129
?>
MDatabaseException
Definição
mdatabaseexception.class:32
MDatabaseException\generateMessage
generateMessage($svnInfo='')
Definição
mdatabaseexception.class:49
MDatabaseException\UNKNOWN_ERROR_CODE
const UNKNOWN_ERROR_CODE
Definição
mdatabaseexception.class:40
MDatabaseException\__toString
__toString()
Definição
mdatabaseexception.class:103
MDatabaseException\setSqlError
setSqlError($sqlError)
Definição
mdatabaseexception.class:125
MDatabaseException\getSqlError
getSqlError()
Definição
mdatabaseexception.class:121
MDatabaseException\KNOWN_ERROR_CODE
const KNOWN_ERROR_CODE
Definição
mdatabaseexception.class:41
MForm\expansibleText
static expansibleText($labelExpand, $labelCollapse, $text)
Definição
mform.class:3003
MIOLO\getInstance
static getInstance()
Definição
miolo.class:134
MUtil\getBooleanValue
static getBooleanValue($value)
Definição
mutil.class:100
$MIOLO
$MIOLO
Definição
mdatetimefield.class:25
classes
flow
mdatabaseexception.class
Gerado por
1.10.0