PHP Class Bravo3\Orm\Mappers\Metadata\Entity

Afficher le fichier Open project: bravo3/orm Class Usage Examples

Protected Properties

Свойство Type Description
$class_name string
$columns Column[]
$id_columns Column[]
$indices Bravo3\Orm\Mappers\Metadata\Index[]
$property_map array Used to lookup the property that matches a getter/setter function
$relationships Relationship[]
$sortables Sortable[]
$table_name string

Méthodes publiques

Méthode Description
__construct ( string $class_name, string $table_name )
addColumn ( Column $column ) Add a column
addIndex ( Bravo3\Orm\Mappers\Metadata\Index $index ) Add an index
addRelationship ( Relationship $relationship ) Add a relationship
addSortable ( Sortable $sortable ) Add a sortable to the table metadata
getClassName ( ) : string Get ClassName
getColumnByProperty ( $name ) : Column | null Get a column by its property name, or null if no such column exists
getColumns ( ) : Column[] Get columns
getIdColumns ( ) : Column[] Get all columns that are marked an as an ID field
getIndexByName ( string $name ) : Bravo3\Orm\Mappers\Metadata\Index | null Get an index by its name, or null if no such index exists
getIndices ( ) : Bravo3\Orm\Mappers\Metadata\Index[] Get indices
getPropertyFor ( string $fn ) : string | null Get the name of the property matching the given function
getRelationshipByName ( string $name ) : Relationship | null Get a relationship by its name, or null if no such relationship exists
getRelationships ( ) : Relationship[] Get relationships
getSortableByName ( string $name ) : Sortable | null Get a table sortable by name
getSortables ( ) : Sortable[] Get Sortables
getTableName ( ) : string Get the entity class name
setClassName ( string $class_name ) Set the entity class name
setColumns ( array $columns ) Set columns
setIndices ( array $indices ) Set indices
setRelationships ( array $relationships ) Set relationships
setSortables ( array $sortables ) Set Sortables
setTableName ( string $table_name ) Set TableName

Private Methods

Méthode Description
generatePropertyMap ( ) Generate a list of all getters/setters and what property they refer to
resetMaps ( ) Clear the maps based on the columns

Method Details

__construct() public méthode

public __construct ( string $class_name, string $table_name )
$class_name string
$table_name string

addColumn() public méthode

Add a column
public addColumn ( Column $column )
$column Column

addIndex() public méthode

Add an index
public addIndex ( Bravo3\Orm\Mappers\Metadata\Index $index )
$index Bravo3\Orm\Mappers\Metadata\Index

addRelationship() public méthode

Add a relationship
public addRelationship ( Relationship $relationship )
$relationship Relationship

addSortable() public méthode

Add a sortable to the table metadata
public addSortable ( Sortable $sortable )
$sortable Sortable

getClassName() public méthode

Get ClassName
public getClassName ( ) : string
Résultat string

getColumnByProperty() public méthode

Get a column by its property name, or null if no such column exists
public getColumnByProperty ( $name ) : Column | null
$name
Résultat Column | null

getColumns() public méthode

Get columns
public getColumns ( ) : Column[]
Résultat Column[]

getIdColumns() public méthode

Get all columns that are marked an as an ID field
public getIdColumns ( ) : Column[]
Résultat Column[]

getIndexByName() public méthode

Get an index by its name, or null if no such index exists
public getIndexByName ( string $name ) : Bravo3\Orm\Mappers\Metadata\Index | null
$name string
Résultat Bravo3\Orm\Mappers\Metadata\Index | null

getIndices() public méthode

Get indices
public getIndices ( ) : Bravo3\Orm\Mappers\Metadata\Index[]
Résultat Bravo3\Orm\Mappers\Metadata\Index[]

getPropertyFor() public méthode

Get the name of the property matching the given function
public getPropertyFor ( string $fn ) : string | null
$fn string
Résultat string | null

getRelationshipByName() public méthode

Get a relationship by its name, or null if no such relationship exists
public getRelationshipByName ( string $name ) : Relationship | null
$name string
Résultat Relationship | null

getRelationships() public méthode

Get relationships
public getRelationships ( ) : Relationship[]
Résultat Relationship[]

getSortableByName() public méthode

Get a table sortable by name
public getSortableByName ( string $name ) : Sortable | null
$name string
Résultat Sortable | null

getSortables() public méthode

Get Sortables
public getSortables ( ) : Sortable[]
Résultat Sortable[]

getTableName() public méthode

Get the entity class name
public getTableName ( ) : string
Résultat string

setClassName() public méthode

Set the entity class name
public setClassName ( string $class_name )
$class_name string

setColumns() public méthode

Set columns
public setColumns ( array $columns )
$columns array

setIndices() public méthode

Set indices
public setIndices ( array $indices )
$indices array

setRelationships() public méthode

Set relationships
public setRelationships ( array $relationships )
$relationships array

setSortables() public méthode

Set Sortables
public setSortables ( array $sortables )
$sortables array

setTableName() public méthode

Set TableName
public setTableName ( string $table_name )
$table_name string

Property Details

$class_name protected_oe property

protected string $class_name
Résultat string

$columns protected_oe property

protected Column[],Bravo3\Orm\Mappers\Metadata $columns
Résultat Column[]

$id_columns protected_oe property

protected Column[],Bravo3\Orm\Mappers\Metadata $id_columns
Résultat Column[]

$indices protected_oe property

protected Index[],Bravo3\Orm\Mappers\Metadata $indices
Résultat Bravo3\Orm\Mappers\Metadata\Index[]

$property_map protected_oe property

Used to lookup the property that matches a getter/setter function
protected array $property_map
Résultat array

$relationships protected_oe property

protected Relationship[],Bravo3\Orm\Mappers\Metadata $relationships
Résultat Relationship[]

$sortables protected_oe property

protected Sortable[],Bravo3\Orm\Mappers\Metadata $sortables
Résultat Sortable[]

$table_name protected_oe property

protected string $table_name
Résultat string