PHP Class Drest\Mapping\Driver\AnnotationDriver

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

Protected Properties

Property Type Description
$classNames array The array of class names.
$extensions array Extensions of the files to read

Public Methods

Method 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

Protected Methods

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

Method Details

__construct() public method

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

addExtension() public method

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 method

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

getAllClassNames() public method

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

isDrestResource() public method

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

loadMetadataForClass() public method

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
return Drest\Mapping\ClassMetaData | null $metaData - return null if metadata couldn't be populated from annotations

processMethods() protected method

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

register() public static method

Driver registration template method.
public static register ( )

registerAnnotations() public static method

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

removeExtensions() public method

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
return array

$extensions protected_oe property

Extensions of the files to read
protected array $extensions
return array