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 ConventionalReflection

Reflection metadata class for a database.

Nette\Object
Extended by Nette\Database\Reflection\ConventionalReflection implements Nette\Database\IReflection
Namespace: Nette\Database\Reflection
Author: Jakub Vrana
Author: Jan Skrasek
Located at Database/Reflection/ConventionalReflection.php
Methods summary
public
# __construct( string $primary = 'id', string $foreign = '%s_id', string $table = '%s' )

Create conventional structure.

Create conventional structure.

Parameters

$primary
string
%s stands for table name
$foreign
string
%1$s stands for key used after ->, %2$s for table name
$table
string
%1$s stands for key used after ->, %2$s for table name
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 )

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

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 )

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

Returns

array
array(referenced table, referencing column)

Throws

Reflection\MissingReferenceException

Implementation of

Nette\Database\IReflection::getBelongsToReference()
protected
# getColumnFromTable( $name )
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 string $primary
#
protected string $foreign
#
protected string $table
#
Magic properties inherited from Nette\Object
$reflection
Nette 2.1 API documentation generated by ApiGen 2.8.0