PHP Class Drest\Mapping\Driver\AnnotationDriver

Doesn't require paths / file extensions as entities are pull from the doctrine entity manager
Inheritance: extends AbstractDriver
Afficher le fichier Open project: leedavis81/drest Class Usage Examples

Protected Properties

Свойство Type Description
$classNames array The array of class names.
$extensions array Extensions of the files to read

Méthodes publiques

Méthode Description
__construct ( AnnotationReader $reader, $paths = [] )
addExtension ( string $extension ) Add an extension to look for classes
create ( array | string $paths = [] ) : AnnotationDriver Factory method for the Annotation Driver
getAllClassNames ( ) : array Get all the metadata class names known to this driver.
isDrestResource ( string $className ) : boolean Does the class contain a drest resource object
loadMetadataForClass ( object | string $className ) : Drest\Mapping\ClassMetaData | null Load metadata for a class name
register ( ) Driver registration template method.
registerAnnotations ( ) Register out annotation classes with the annotation registry.
removeExtensions ( string $extension = null ) Remove all registered extensions, if an extension name is passed, only remove that entry

Méthodes protégées

Méthode Description
processMethods ( ReflectionMethod[] $methods, Drest\Mapping\ClassMetaData $metadata ) Process the method

Method Details

__construct() public méthode

public __construct ( AnnotationReader $reader, $paths = [] )
$reader Doctrine\Common\Annotations\AnnotationReader

addExtension() public méthode

Add an extension to look for classes
public addExtension ( string $extension )
$extension string - can be a string or an array of extensions

create() public static méthode

Factory method for the Annotation Driver
public static create ( array | string $paths = [] ) : AnnotationDriver
$paths array | string
Résultat AnnotationDriver

getAllClassNames() public méthode

Get all the metadata class names known to this driver.
public getAllClassNames ( ) : array
Résultat array $classes

isDrestResource() public méthode

Does the class contain a drest resource object
public isDrestResource ( string $className ) : boolean
$className string
Résultat boolean

loadMetadataForClass() public méthode

Load metadata for a class name
public loadMetadataForClass ( object | string $className ) : Drest\Mapping\ClassMetaData | null
$className object | string - Pass in either the class name, or an instance of that class
Résultat Drest\Mapping\ClassMetaData | null $metaData - return null if metadata couldn't be populated from annotations

processMethods() protected méthode

Process the method
protected processMethods ( ReflectionMethod[] $methods, Drest\Mapping\ClassMetaData $metadata )
$methods ReflectionMethod[]
$metadata Drest\Mapping\ClassMetaData

register() public static méthode

Driver registration template method.
public static register ( )

registerAnnotations() public static méthode

Register out annotation classes with the annotation registry.
public static registerAnnotations ( )

removeExtensions() public méthode

Remove all registered extensions, if an extension name is passed, only remove that entry
public removeExtensions ( string $extension = null )
$extension string

Property Details

$classNames protected_oe property

The array of class names.
protected array $classNames
Résultat array

$extensions protected_oe property

Extensions of the files to read
protected array $extensions
Résultat array