Conditions | 5 |
Paths | 5 |
Total Lines | 19 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
38 | public function parse($rawValue) |
||
39 | { |
||
40 | if ($rawValue === null) { |
||
41 | return null; |
||
42 | } |
||
43 | if (!is_array($rawValue)) { |
||
44 | throw new ParsingException($this->getErrorMessage()); |
||
45 | } |
||
46 | try { |
||
47 | $object = $this->dbProvider->getObject($this->table, $rawValue); |
||
48 | if ($object === null) { |
||
49 | throw new ParsingException($this->getErrorMessage()); |
||
50 | } else { |
||
51 | return $object; |
||
52 | } |
||
53 | } catch (DBException $exception) { |
||
54 | throw new ParsingException($this->getErrorMessage()); |
||
55 | } |
||
56 | } |
||
57 | } |