PHP Class Bravo3\Orm\Mappers\Annotation\AnnotationMetadataParser

Show file Open project: bravo3/orm Class Usage Examples

Protected Properties

Property Type Description
$annotation_reader Doctrine\Common\Annotations\AnnotationReader
$class_name string
$entity_annotation Bravo3\Orm\Annotations\Entity
$reflection_obj ReflectionClass

Public Methods

Method Description
__construct ( $class_name )
getColumns ( ) : Column[] Get all columns in the entity
getEntityAnnotation ( ) : Entity Lazy-load @Entity annotation
getEntityMetadata ( boolean $shallow = false ) : Entity Get the Entity metadata object
getIndices ( ) : Bravo3\Orm\Mappers\Metadata\Index[] Get all indices on the entity
getRelationships ( ) : Relationship[] Get all relationships in the entity
getSortables ( ) : Sortable[] Get table sortables
getTableName ( ) : string Gets the entity table name

Private Methods

Method Description
createRelationship ( string $name, RelationshipType $type, AbstractRelationshipAnnotation $annotation ) : Relationship Create a relationship from an annotation
getOrganicTableName ( ) : string Get the table name by inflecting the class name
parseColumnAnnotation ( Column $column_annotation, string $name ) : Column Parse a ColumnAnnotation and return a Column object
testConditionAnnotation ( Condition $condition ) Check a condition and throw an exception if it is invalid
validateTableName ( ) Throw an exception if the table name contains illegal chars

Method Details

__construct() public method

public __construct ( $class_name )

getColumns() public method

Get all columns in the entity
public getColumns ( ) : Column[]
return Bravo3\Orm\Mappers\Metadata\Column[]

getEntityAnnotation() public method

Lazy-load @Entity annotation
public getEntityAnnotation ( ) : Entity
return Bravo3\Orm\Annotations\Entity

getEntityMetadata() public method

Get the Entity metadata object
public getEntityMetadata ( boolean $shallow = false ) : Entity
$shallow boolean
return Bravo3\Orm\Mappers\Metadata\Entity

getIndices() public method

Get all indices on the entity
public getIndices ( ) : Bravo3\Orm\Mappers\Metadata\Index[]
return Bravo3\Orm\Mappers\Metadata\Index[]

getRelationships() public method

Get all relationships in the entity
public getRelationships ( ) : Relationship[]
return Bravo3\Orm\Mappers\Metadata\Relationship[]

getSortables() public method

Get table sortables
public getSortables ( ) : Sortable[]
return Bravo3\Orm\Mappers\Metadata\Sortable[]

getTableName() public method

Gets the entity table name
public getTableName ( ) : string
return string

Property Details

$annotation_reader protected property

protected AnnotationReader,Doctrine\Common\Annotations $annotation_reader
return Doctrine\Common\Annotations\AnnotationReader

$class_name protected property

protected string $class_name
return string

$entity_annotation protected property

protected Entity,Bravo3\Orm\Annotations $entity_annotation
return Bravo3\Orm\Annotations\Entity

$reflection_obj protected property

protected ReflectionClass $reflection_obj
return ReflectionClass