| @@ 85-97 (lines=13) @@ | ||
| 82 | return $return; |
|
| 83 | } |
|
| 84 | ||
| 85 | public function get($type, $key) { |
|
| 86 | $data = $this->getData(); |
|
| 87 | $return = (isset($data[$type][$key])) ? FakeObject::create_from_array($data[$type][$key]) : null; |
|
| 88 | ||
| 89 | // $this->log(sprintf( |
|
| 90 | // 'Get fake %s#%s: %s', |
|
| 91 | // $type, |
|
| 92 | // $key, |
|
| 93 | // json_encode($return) |
|
| 94 | // )); |
|
| 95 | ||
| 96 | return $return; |
|
| 97 | } |
|
| 98 | ||
| 99 | public function getAll($type) { |
|
| 100 | $data = $this->getData(); |
|
| @@ 99-109 (lines=11) @@ | ||
| 96 | return $return; |
|
| 97 | } |
|
| 98 | ||
| 99 | public function getAll($type) { |
|
| 100 | $data = $this->getData(); |
|
| 101 | if(!isset($data[$type])) return false; |
|
| 102 | ||
| 103 | $return = array(); |
|
| 104 | foreach($data[$type] as $record) { |
|
| 105 | $return[] = FakeObject::create_from_array($record); |
|
| 106 | } |
|
| 107 | ||
| 108 | return $return; |
|
| 109 | } |
|
| 110 | ||
| 111 | /** |
|
| 112 | * Sets a new record. Replaces existing records with the same key. |
|