PHP Class Bolt\Storage\Mapping\MetadataDriver

Author: Ross Riley ([email protected])
Inheritance: implements Doctrine\Common\Persistence\Mapping\Driver\MappingDriver
Afficher le fichier Open project: bolt/bolt Class Usage Examples

Protected Properties

Свойство Type Description
$aliases array
$contenttypes array
$defaultAliases array
$fallbackEntity A default entity for any table not matched
$initialized boolean
$metadata metadata mappings
$namingStrategy Bolt\Storage\NamingStrategy
$schemaManager Bolt\Storage\Database\Schema\Manager
$taxonomies taxonomy configuration
$typemap array
$unmapped array Keeps a reference of which metadata is not mapped to a specific entity.

Méthodes publiques

Méthode Description
__construct ( Manager $schemaManager, ConfigurationValueProxy $contenttypes, ConfigurationValueProxy $taxonomies, array $typemap, Bolt\Storage\NamingStrategy $namingStrategy = null ) Constructor.
getAliases ( ) : array Getter for aliases
getAllClassNames ( )
getClassMetadata ( string $className ) : Doctrine\Common\Persistence\Mapping\ClassMetadata | false Returns the metadata for a given class name.
getContentTypeFromAlias ( $alias, boolean $forceSlug = false ) : string Given a tablename or slug get the correct Bolt keyname from the config
getFieldMetadata ( $contenttype, $column, $field = null )
getFieldTypeFor ( string $name, Doctrine\DBAL\Schema\Column $column, null $field = null ) : string Get the field type for a given column.
getRepeaterMapping ( array $config ) : array This is a helper method to get a correct mapping from an array config. It's designed to take raw array config to generate a correct format mapping for repeaters.
getTaxonomyConfig ( ) : array
getUnmapped ( ) : array Gets a list of tables that are not mapped to specific entities.
initialize ( ) Reads the schema from Bolt\Storage\Database\Schema\Manager and creates mapping data
initializeDefaultAliases ( ) This seeds the defaultAliases array with the correctly prefixed mappings
initializeShortAliases ( ) Setup some short aliases so non prefixed keys can be used to get metadata
isTransient ( string $className ) : boolean Not implemented, always returns false.
loadMetadataForClass ( $className, Doctrine\Common\Persistence\Mapping\ClassMetadata $metadata = null )
loadMetadataForFields ( array $fields )
resolveClassName ( string $alias ) : string Method will try to find an entity class name to handle data, alternatively falling back to $this->fallbackEntity
setContentFields ( $contentKey, $className, $table )
setDefaultAlias ( string $alias, string $entity ) : void Adds an alias mapping from an internal name to a Fully Qualified Entity.
setIncomingRelations ( $contentKey, $className )
setRelations ( string $contentKey, string $className, Doctrine\DBAL\Schema\Table $table ) Set the relationship.
setRepeaters ( string $contentKey, string $className, array $inputData = null ) : array | null
setTaxonomies ( string $contentKey, string $className, Doctrine\DBAL\Schema\Table $table ) Set the taxonomy.
setTemplatefields ( string $contentKey, string $className, Doctrine\DBAL\Schema\Table $table ) Setup a templatefields field if needed.

Méthodes protégées

Méthode Description
loadMetadataForTable ( Doctrine\DBAL\Schema\Table $table ) Load the metadata for a table.
normalizeClassName ( $className ) : string Performs basic normalisation on a searched for class name to make sure it conforms to lookup format.

Method Details

__construct() public méthode

Constructor.
public __construct ( Manager $schemaManager, ConfigurationValueProxy $contenttypes, ConfigurationValueProxy $taxonomies, array $typemap, Bolt\Storage\NamingStrategy $namingStrategy = null )
$schemaManager Bolt\Storage\Database\Schema\Manager
$contenttypes Bolt\Configuration\ConfigurationValueProxy
$taxonomies Bolt\Configuration\ConfigurationValueProxy
$typemap array
$namingStrategy Bolt\Storage\NamingStrategy

getAliases() public méthode

Getter for aliases
public getAliases ( ) : array
Résultat array

getAllClassNames() public méthode

public getAllClassNames ( )

getClassMetadata() public méthode

Returns the metadata for a given class name.
public getClassMetadata ( string $className ) : Doctrine\Common\Persistence\Mapping\ClassMetadata | false
$className string
Résultat Doctrine\Common\Persistence\Mapping\ClassMetadata | false The class metadata.

getContentTypeFromAlias() public méthode

Given a tablename or slug get the correct Bolt keyname from the config
public getContentTypeFromAlias ( $alias, boolean $forceSlug = false ) : string
$alias
$forceSlug boolean
Résultat string $key

getFieldMetadata() public méthode

public getFieldMetadata ( $contenttype, $column, $field = null )

getFieldTypeFor() public méthode

Get the field type for a given column.
public getFieldTypeFor ( string $name, Doctrine\DBAL\Schema\Column $column, null $field = null ) : string
$name string
$column Doctrine\DBAL\Schema\Column
$field null Optional field value for repeaters/array based columns
Résultat string

getRepeaterMapping() public méthode

This is a helper method to get a correct mapping from an array config. It's designed to take raw array config to generate a correct format mapping for repeaters.
public getRepeaterMapping ( array $config ) : array
$config array
Résultat array

getTaxonomyConfig() public méthode

public getTaxonomyConfig ( ) : array
Résultat array

getUnmapped() public méthode

Gets a list of tables that are not mapped to specific entities.
public getUnmapped ( ) : array
Résultat array

initialize() public méthode

Reads the schema from Bolt\Storage\Database\Schema\Manager and creates mapping data
public initialize ( )

initializeDefaultAliases() public méthode

This seeds the defaultAliases array with the correctly prefixed mappings

initializeShortAliases() public méthode

Setup some short aliases so non prefixed keys can be used to get metadata

isTransient() public méthode

Not implemented, always returns false.
public isTransient ( string $className ) : boolean
$className string
Résultat boolean

loadMetadataForClass() public méthode

public loadMetadataForClass ( $className, Doctrine\Common\Persistence\Mapping\ClassMetadata $metadata = null )
$metadata Doctrine\Common\Persistence\Mapping\ClassMetadata

loadMetadataForFields() public méthode

public loadMetadataForFields ( array $fields )
$fields array

loadMetadataForTable() protected méthode

Load the metadata for a table.
protected loadMetadataForTable ( Doctrine\DBAL\Schema\Table $table )
$table Doctrine\DBAL\Schema\Table

normalizeClassName() protected méthode

Performs basic normalisation on a searched for class name to make sure it conforms to lookup format.
protected normalizeClassName ( $className ) : string
$className
Résultat string

resolveClassName() public méthode

Method will try to find an entity class name to handle data, alternatively falling back to $this->fallbackEntity
public resolveClassName ( string $alias ) : string
$alias string
Résultat string Fully Qualified Class Name

setContentFields() public méthode

public setContentFields ( $contentKey, $className, $table )

setDefaultAlias() public méthode

Adds an alias mapping from an internal name to a Fully Qualified Entity.
public setDefaultAlias ( string $alias, string $entity ) : void
$alias string
$entity string
Résultat void

setIncomingRelations() public méthode

public setIncomingRelations ( $contentKey, $className )
$contentKey
$className

setRelations() public méthode

Set the relationship.
public setRelations ( string $contentKey, string $className, Doctrine\DBAL\Schema\Table $table )
$contentKey string
$className string
$table Doctrine\DBAL\Schema\Table

setRepeaters() public méthode

public setRepeaters ( string $contentKey, string $className, array $inputData = null ) : array | null
$contentKey string
$className string
$inputData array
Résultat array | null

setTaxonomies() public méthode

Set the taxonomy.
public setTaxonomies ( string $contentKey, string $className, Doctrine\DBAL\Schema\Table $table )
$contentKey string
$className string
$table Doctrine\DBAL\Schema\Table

setTemplatefields() public méthode

Setup a templatefields field if needed.
public setTemplatefields ( string $contentKey, string $className, Doctrine\DBAL\Schema\Table $table )
$contentKey string
$className string
$table Doctrine\DBAL\Schema\Table

Property Details

$aliases protected_oe property

protected array $aliases
Résultat array

$contenttypes protected_oe property

protected array $contenttypes
Résultat array

$defaultAliases protected_oe property

protected array $defaultAliases
Résultat array

$fallbackEntity protected_oe property

A default entity for any table not matched
protected $fallbackEntity

$initialized protected_oe property

protected bool $initialized
Résultat boolean

$metadata protected_oe property

metadata mappings
protected $metadata

$namingStrategy protected_oe property

protected NamingStrategy,Bolt\Storage $namingStrategy
Résultat Bolt\Storage\NamingStrategy

$schemaManager protected_oe property

protected Manager,Bolt\Storage\Database\Schema $schemaManager
Résultat Bolt\Storage\Database\Schema\Manager

$taxonomies protected_oe property

taxonomy configuration
protected $taxonomies

$typemap protected_oe property

protected array $typemap
Résultat array

$unmapped protected_oe property

Keeps a reference of which metadata is not mapped to a specific entity.
protected array $unmapped
Résultat array