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

  • DiscoveredConventions
  • StaticConventions

Exceptions

  • AmbiguousReferenceKeyException
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Other releases

Class StaticConventions

Conventions based on static definition.

Nette\Database\Conventions\StaticConventions implements Nette\Database\IConventions uses Nette\SmartObject
Namespace: Nette\Database\Conventions
Located at Database/Conventions/StaticConventions.php
Methods summary
public
# __construct( string $primary = 'id', string $foreign = '%s_id', string $table = '%s' )

Create static conventional structure.

Create static conventional structure.

Parameters

$primary
stands for table name
$foreign
$s stands for key used after ->, %2$s for table name
$table
$s stands for key used after ->, %2$s for table name
public string|array|null
# getPrimary( string $table )

Returns primary key for table.

Returns primary key for table.

Parameters

$table

Returns

string|array|null
string|array|null

Implementation of

Nette\Database\IConventions::getPrimary()
public array|null
# getHasManyReference( string $table, string $key )

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

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

Parameters

$table
table
$key
key

Returns

array|null
array(referenced table, referenced column)

Throws

Nette\Database\Conventions\AmbiguousReferenceKeyException
AmbiguousReferenceKeyException

Implementation of

Nette\Database\IConventions::getHasManyReference()
public array|null
# getBelongsToReference( string $table, string $key )

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

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

Parameters

$table
table
$key
key

Returns

array|null
array(referenced table, referencing column)

Implementation of

Nette\Database\IConventions::getBelongsToReference()
protected
# getColumnFromTable( $name )
Methods used from Nette\SmartObject
__call(), __callStatic(), __get(), __isset(), __set(), __unset(), extensionMethod(), getReflection()
Properties summary
protected string $primary
#
protected string $foreign
#
protected string $table
#
Nette 2.4-20180918 API API documentation generated by ApiGen 2.8.0