Rev 34 | Rev 50 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 34 | Rev 35 | ||
|---|---|---|---|
| Line 224... | Line 224... | ||
| 224 | 224 | ||
| 225 | /**
|
225 | /**
|
| 226 | * Finds a record by ID
|
226 | * Finds a record by ID
|
| 227 | *
|
227 | *
|
| 228 | * @param mixed $id
|
228 | * @param mixed $id
|
| - | 229 | * @return array
|
|
| 229 | */
|
230 | */
|
| 230 | public function find($id) |
231 | public function find($id) |
| 231 | {
|
232 | {
|
| 232 | /* DEBUG */
|
233 | /* DEBUG */
|
| 233 | if (defined('DEBUG') && DEBUG > 0) |
234 | if (defined('DEBUG') && DEBUG > 0) |
| 234 | {
|
235 | {
|
| 235 | debug($id); |
236 | debug($id); |
| 236 | }
|
237 | }
|
| 237 | 238 | ||
| 238 | return $this->select(null, array($this->_id => $id)); |
239 | $result = $this->select(null, array($this->_id => $id)); |
| - | 240 | ||
| - | 241 | if ($result) |
|
| - | 242 | {
|
|
| - | 243 | $result = $result[0]; |
|
| - | 244 | }
|
|
| - | 245 | ||
| - | 246 | return $result; |
|
| 239 | }
|
247 | }
|
| 240 | }
|
248 | }
|
| 241 | 249 | ||