Namespaces

  • Latte
    • Loaders
    • Macros
    • Runtime
  • Nette
    • Application
      • Responses
      • Routers
      • UI
    • Bridges
      • ApplicationDI
      • ApplicationLatte
      • ApplicationTracy
      • CacheDI
      • CacheLatte
      • DatabaseDI
      • DatabaseTracy
      • DITracy
      • FormsDI
      • FormsLatte
      • Framework
      • HttpDI
      • HttpTracy
      • MailDI
      • ReflectionDI
      • SecurityDI
      • SecurityTracy
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Conventions
      • Drivers
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
      • Traits
    • Reflection
    • Security
    • Tokenizer
    • Utils
  • Tracy
    • Bridges
      • Nette
  • none

Classes

  • Connection
  • Context
  • Helpers
  • ResultSet
  • Row
  • SqlLiteral
  • SqlPreprocessor
  • Structure

Interfaces

  • IConventions
  • IRow
  • IRowContainer
  • IStructure
  • ISupplementalDriver

Exceptions

  • ConnectionException
  • ConstraintViolationException
  • DriverException
  • ForeignKeyConstraintViolationException
  • NotNullConstraintViolationException
  • UniqueConstraintViolationException
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Other releases
 1: <?php
 2: 
 3: /**
 4:  * This file is part of the Nette Framework (https://nette.org)
 5:  * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
 6:  */
 7: 
 8: namespace Nette\Database;
 9: 
10: use Nette;
11: 
12: 
13: /**
14:  * Represents a single table row.
15:  */
16: class Row extends Nette\Utils\ArrayHash implements IRow
17: {
18:     public function __get($key)
19:     {
20:         $hint = Nette\Utils\ObjectMixin::getSuggestion(array_keys((array) $this), $key);
21:         throw new Nette\MemberAccessException("Cannot read an undeclared column '$key'" . ($hint ? ", did you mean '$hint'?" : '.'));
22:     }
23: 
24: 
25:     /**
26:      * Returns a item.
27:      * @param  mixed  key or index
28:      * @return mixed
29:      */
30:     public function offsetGet($key)
31:     {
32:         if (is_int($key)) {
33:             $arr = array_slice((array) $this, $key, 1);
34:             if (!$arr) {
35:                 throw new Nette\MemberAccessException("Cannot read an undeclared column '$key'.");
36:             }
37:             return current($arr);
38:         }
39:         return $this->$key;
40:     }
41: 
42: 
43:     /**
44:      * Checks if $key exists.
45:      * @param  mixed  key or index
46:      * @return bool
47:      */
48:     public function offsetExists($key)
49:     {
50:         if (is_int($key)) {
51:             return (bool) current(array_slice((array) $this, $key, 1));
52:         }
53:         return parent::offsetExists($key);
54:     }
55: }
56: 
Nette 2.4-20180918 API API documentation generated by ApiGen 2.8.0