1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* exceptions.php. |
5
|
|
|
* |
6
|
|
|
* This file implements some expection classes which are used within the |
7
|
|
|
* PHPSQLParser package. |
8
|
|
|
* |
9
|
|
|
* Copyright (c) 2010-2012, Justin Swanhart |
10
|
|
|
* with contributions by André Rothe <[email protected], [email protected]> |
11
|
|
|
* |
12
|
|
|
* All rights reserved. |
13
|
|
|
* |
14
|
|
|
* Redistribution and use in source and binary forms, with or without modification, |
15
|
|
|
* are permitted provided that the following conditions are met: |
16
|
|
|
* |
17
|
|
|
* * Redistributions of source code must retain the above copyright notice, |
18
|
|
|
* this list of conditions and the following disclaimer. |
19
|
|
|
* * Redistributions in binary form must reproduce the above copyright notice, |
20
|
|
|
* this list of conditions and the following disclaimer in the documentation |
21
|
|
|
* and/or other materials provided with the distribution. |
22
|
|
|
* |
23
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY |
24
|
|
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
25
|
|
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT |
26
|
|
|
* SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
27
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED |
28
|
|
|
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
29
|
|
|
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
30
|
|
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
31
|
|
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH |
32
|
|
|
* DAMAGE. |
33
|
|
|
*/ |
34
|
|
|
namespace SQLParser; |
35
|
|
|
|
36
|
|
|
class UnableToCreateSQLException extends \Exception |
37
|
|
|
{ |
38
|
|
|
protected $part; |
39
|
|
|
protected $partkey; |
40
|
|
|
protected $entry; |
41
|
|
|
protected $entrykey; |
42
|
|
|
|
43
|
|
|
public function __construct($part, $partkey, $entry, $entrykey) |
44
|
|
|
{ |
45
|
|
|
$this->part = $part; |
46
|
|
|
$this->partkey = $partkey; |
47
|
|
|
$this->entry = $entry; |
48
|
|
|
$this->entrykey = $entrykey; |
49
|
|
|
parent::__construct('unknown '.$entrykey.' in '.$part.'['.$partkey.'] '.$entry[$entrykey], 15); |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
public function getEntry() |
53
|
|
|
{ |
54
|
|
|
return $this->entry; |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
public function getEntryKey() |
58
|
|
|
{ |
59
|
|
|
return $this->entrykey; |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
public function getSQLPart() |
63
|
|
|
{ |
64
|
|
|
return $this->part; |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
public function getSQLPartKey() |
68
|
|
|
{ |
69
|
|
|
return $this->partkey; |
70
|
|
|
} |
71
|
|
|
} |
72
|
|
|
|