PHP Class Bravo3\Orm\Mappers\Yaml\YamlMapper

Inheritance: extends Bravo3\Orm\Mappers\AbstractMapper, implements Bravo3\Orm\Mappers\DereferencingMapperInterface
Show file Open project: bravo3/orm

Protected Properties

Property Type Description
$entities Bravo3\Orm\Mappers\Metadata\Entity[]

Public Methods

Method Description
__construct ( array $maps = [] )
getClassFromTable ( string $table_name ) : string Get an entities full class name from its table name
getEntityMetadata ( string | object $entity ) : Entity Get the metadata for an entity, including column information
registerMap ( string $fn ) Register a new map file

Protected Methods

Method Description
getNode ( array $map, string $node, boolean $required = true, mixed $default = null ) : mixed Get a node from the metadata map
getParser ( ) : Symfony\Component\Yaml\Yaml Lazy-load the YAML parser
loadMap ( string $fn ) Parse a map file, loading metadata from YAML
processMaps ( ) Process all unprocessed map files

Private Methods

Method Description
createColumn ( string $property, array $column_schema ) : Column Create a column from schema
createRelationship ( string $property, array $column_schema ) : Relationship Create a relationship from schema
createSortables ( array $column_schema ) : Sortable[] Create a set of sortables

Method Details

__construct() public method

public __construct ( array $maps = [] )
$maps array

getClassFromTable() public method

Get an entities full class name from its table name
public getClassFromTable ( string $table_name ) : string
$table_name string
return string

getEntityMetadata() public method

If you do not provide a $relative_mapper then relationship metadata will not be hydrated.
public getEntityMetadata ( string | object $entity ) : Entity
$entity string | object Entity or class name of the entity
return Bravo3\Orm\Mappers\Metadata\Entity

getNode() protected method

Get a node from the metadata map
protected getNode ( array $map, string $node, boolean $required = true, mixed $default = null ) : mixed
$map array
$node string
$required boolean
$default mixed
return mixed

getParser() protected method

Lazy-load the YAML parser
protected getParser ( ) : Symfony\Component\Yaml\Yaml
return Symfony\Component\Yaml\Yaml

loadMap() protected method

Parse a map file, loading metadata from YAML
protected loadMap ( string $fn )
$fn string

processMaps() protected method

Process all unprocessed map files
protected processMaps ( )

registerMap() public method

Register a new map file
public registerMap ( string $fn )
$fn string

Property Details

$entities protected property

protected Entity[],Bravo3\Orm\Mappers\Metadata $entities
return Bravo3\Orm\Mappers\Metadata\Entity[]