Namespaces

  • Nette
    • Application
      • Diagnostics
      • Responses
      • Routers
      • UI
    • Caching
      • Storages
    • ComponentModel
    • Config
      • Adapters
      • Extensions
    • Database
      • Diagnostics
      • Drivers
      • Reflection
      • Table
    • DI
      • Diagnostics
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Latte
      • Macros
    • Loaders
    • Localization
    • Mail
    • Reflection
    • Security
      • Diagnostics
    • Templating
    • Utils
      • PhpGenerator
  • NetteModule
  • None
  • PHP

Classes

  • Connection
  • Helpers
  • Row
  • SqlLiteral
  • SqlPreprocessor
  • Statement

Interfaces

  • IReflection
  • ISupplementalDriver
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
 1: <?php
 2: 
 3: /**
 4:  * This file is part of the Nette Framework (http://nette.org)
 5:  *
 6:  * Copyright (c) 2004 David Grudl (http://davidgrudl.com)
 7:  *
 8:  * For the full copyright and license information, please view
 9:  * the file license.txt that was distributed with this source code.
10:  */
11: 
12: namespace Nette\Database;
13: 
14: use Nette;
15: 
16: 
17: 
18: /**
19:  * Represents a single table row.
20:  *
21:  * @author     David Grudl
22:  */
23: class Row extends Nette\ArrayHash
24: {
25: 
26:     public function __construct(Statement $statement)
27:     {
28:         $statement->normalizeRow($this);
29:     }
30: 
31: 
32: 
33:     /**
34:      * Returns a item.
35:      * @param  mixed  key or index
36:      * @return mixed
37:      */
38:     public function offsetGet($key)
39:     {
40:         if (is_int($key)) {
41:             $arr = array_values((array) $this);
42:             return $arr[$key];
43:         }
44:         return $this->$key;
45:     }
46: 
47: 
48: 
49:     public function offsetExists($key)
50:     {
51:         if (is_int($key)) {
52:             $arr = array_values((array) $this);
53:             return isset($arr[$key]);
54:         }
55:         return parent::offsetExists($key);
56:     }
57: 
58: }
59: 
Nette Framework 2.0.10 API API documentation generated by ApiGen 2.8.0