Namespaces

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

Classes

  • ConventionalReflection
  • DiscoveredReflection

Exceptions

  • AmbiguousReferenceKeyException
  • MissingReferenceException
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Other releases
  • Nette homepage

Class DiscoveredReflection

Reflection metadata class with discovery for a database.

Nette\Object
Extended by Nette\Database\Reflection\DiscoveredReflection implements Nette\Database\IReflection
Namespace: Nette\Database\Reflection
Author: Jan Skrasek
Located at Database/Reflection/DiscoveredReflection.php
Methods summary
public
# __construct( Nette\Database\Connection $connection, Nette\Caching\IStorage $cacheStorage = NULL )

Create autodiscovery structure.

Create autodiscovery structure.

public
# __destruct( )
public string|array
# getPrimary( string $table )

Gets primary key of $table.

Gets primary key of $table.

Parameters

$table
string

Returns

string|array

Implementation of

Nette\Database\IReflection::getPrimary()
public array
# getHasManyReference( string $table, string $key, $refresh = TRUE )

Gets referenced table & referenced column. Example:
author, book returns array(book, author_id)

Gets referenced table & referenced column. Example: author, book returns array(book, author_id)

Parameters

$table
string
source table
$key
string
referencing key
$refresh

Returns

array
array(referenced table, referenced column)

Throws

Reflection\MissingReferenceException
Reflection\AmbiguousReferenceKeyException

Implementation of

Nette\Database\IReflection::getHasManyReference()
public array
# getBelongsToReference( string $table, string $key, $refresh = TRUE )

Gets referenced table & referencing column. Example
book, author returns array(author, author_id)
book, translator returns array(author, translator_id)

Gets referenced table & referencing column. Example book, author returns array(author, author_id) book, translator returns array(author, translator_id)

Parameters

$table
string
source table
$key
string
referencing key
$refresh

Returns

array
array(referenced table, referencing column)

Throws

Reflection\MissingReferenceException

Implementation of

Nette\Database\IReflection::getBelongsToReference()
protected
# reloadAllForeignKeys( )
protected
# reloadForeignKeys( $table )
Methods inherited from Nette\Object
__call(), __callStatic(), __get(), __isset(), __set(), __unset(), extensionMethod(), getReflection()
Constants inherited from Nette\Database\IReflection
FIELD_BINARY, FIELD_BOOL, FIELD_DATE, FIELD_DATETIME, FIELD_FLOAT, FIELD_INTEGER, FIELD_TEXT, FIELD_TIME, FIELD_TIME_INTERVAL, FIELD_UNIX_TIMESTAMP
Properties summary
protected Nette\Database\Connection $connection
#
protected Nette\Caching\Cache $cache
#
protected array $structure array()
#
protected array $loadedStructure
#
Magic properties inherited from Nette\Object
$reflection
Nette 2.1 API documentation generated by ApiGen 2.8.0