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

  • ConventionalReflection
  • DiscoveredReflection
  • Overview
  • Namespace
  • Class
  • Tree

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
# getPrimary( string $table )

Gets primary key of $table

Gets primary key of $table

Parameters

$table
string

Returns

string

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)

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)

Implementation of

Nette\Database\IReflection::getBelongsToReference
public
# setConnection( Nette\Database\Connection $connection )

Injects database connection.

Injects database connection.

Parameters

$connection
Connection

Implementation of

Nette\Database\IReflection::setConnection
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
Properties summary
protected string $primary
#
protected string $foreign
#
protected string $table
#
Nette Framework 2.0.4 API API documentation generated by ApiGen 2.7.0