Annotations\AdapterFactory
ClassSource on GitHubFactory to create Annotations adapters
@property SerializerFactory $serializerFactory
Phalcon\Factory\AbstractConfigFactoryPhalcon\Factory\AbstractFactoryPhalcon\Annotations\AdapterFactory
Uses Exception · Phalcon\Annotations\Adapter\AdapterInterface · Phalcon\Annotations\Adapter\Apcu · Phalcon\Annotations\Adapter\Libmemcached · Phalcon\Annotations\Adapter\Memory · Phalcon\Annotations\Adapter\Redis · Phalcon\Annotations\Adapter\Stream · Phalcon\Annotations\Adapter\Weak · Phalcon\Annotations\Parser\Exception · Phalcon\Factory\AbstractFactory · Phalcon\Storage\SerializerFactory
Method Summary
public__construct(SerializerFactory $factory,array $services = [])AdapterFactory constructor.
publicAdapterInterfacenewInstance(string $name,array $options = [])Create a new instance of the adapter
protectedstringgetExceptionClass()protectedarraygetServices()Returns the available adapters
Methods
__construct()
public function __construct(
SerializerFactory $factory,
array $services = []
);AdapterFactory constructor.
newInstance()
public function newInstance(
string $name,
array $options = []
): AdapterInterface;Create a new instance of the adapter
getExceptionClass()
protected function getExceptionClass(): string;getServices()
protected function getServices(): array;Returns the available adapters
Annotations\Adapter\AdapterInterface
InterfaceSource on GitHubThis interface must be implemented by adapters in Phalcon\Components\Attributes
Phalcon\Storage\Adapter\AdapterInterfacePhalcon\Annotations\Adapter\AdapterInterface
Uses Phalcon\Storage\Adapter\AdapterInterface
Annotations\Adapter\Apcu
ClassSource on GitHubStores the parsed annotations in apcu.
Phalcon\Storage\Adapter\AbstractAdapterPhalcon\Storage\Adapter\ApcuPhalcon\Annotations\Adapter\Apcu- implementsPhalcon\Annotations\Adapter\AdapterInterface
Uses Phalcon\Annotations\Parser\Reflection · Phalcon\Storage\Adapter\Apcu
Method Summary
Methods
get()
public function get(
string $key,
mixed $defaultValue = null
): mixed;Annotations\Adapter\Libmemcached
ClassSource on GitHubStores the parsed annotations in memory. This adapter is the suitable development/testing
Phalcon\Storage\Adapter\AbstractAdapterPhalcon\Storage\Adapter\LibmemcachedPhalcon\Annotations\Adapter\Libmemcached- implementsPhalcon\Annotations\Adapter\AdapterInterface
Uses Phalcon\Annotations\Parser\Reflection · Phalcon\Storage\Adapter\Libmemcached
Method Summary
Methods
get()
public function get(
string $key,
mixed $defaultValue = null
): mixed;Annotations\Adapter\Memory
ClassSource on GitHubStores the parsed annotations in memory. This adapter is the suitable development/testing
Phalcon\Storage\Adapter\AbstractAdapterPhalcon\Storage\Adapter\MemoryPhalcon\Annotations\Adapter\Memory- implementsPhalcon\Annotations\Adapter\AdapterInterface
Uses Phalcon\Annotations\Parser\Reflection · Phalcon\Storage\Adapter\Memory
Method Summary
Methods
get()
public function get(
string $key,
mixed $defaultValue = null
): mixed;Annotations\Adapter\Redis
ClassSource on GitHubStores the parsed annotations in redis.
Phalcon\Storage\Adapter\AbstractAdapterPhalcon\Storage\Adapter\RedisPhalcon\Annotations\Adapter\Redis- implementsPhalcon\Annotations\Adapter\AdapterInterface
Uses Phalcon\Annotations\Parser\Reflection · Phalcon\Storage\Adapter\Redis
Method Summary
Methods
get()
public function get(
string $key,
mixed $defaultValue = null
): mixed;Annotations\Adapter\Stream
ClassSource on GitHubStores the parsed annotations in memory. This adapter is the suitable development/testing
Phalcon\Storage\Adapter\AbstractAdapterPhalcon\Storage\Adapter\StreamPhalcon\Annotations\Adapter\Stream- implementsPhalcon\Annotations\Adapter\AdapterInterface
Uses Phalcon\Annotations\Parser\Reflection · Phalcon\Storage\Adapter\Stream
Method Summary
Methods
get()
public function get(
string $key,
mixed $defaultValue = null
): mixed;Annotations\Adapter\Weak
ClassSource on GitHubStores the parsed annotations in memory. This adapter is the suitable development/testing
Phalcon\Storage\Adapter\AbstractAdapterPhalcon\Storage\Adapter\WeakPhalcon\Annotations\Adapter\Weak- implementsPhalcon\Annotations\Adapter\AdapterInterface
Uses Phalcon\Annotations\Parser\Reflection · Phalcon\Storage\Adapter\Weak
Method Summary
Methods
get()
public function get(
string $key,
mixed $defaultValue = null
): mixed;Annotations\Annotations
ClassSource on GitHubPhalcon\Annotations\Annotations
Uses Phalcon\Annotations\Parser\Collection · Phalcon\Annotations\Parser\Reader · Phalcon\Annotations\Parser\ReaderInterface · Phalcon\Annotations\Parser\Reflection · Phalcon\Storage\Adapter\AdapterInterface
Method Summary
public__construct(AdapterInterface $adapter)publicReflectionget(mixed $className)Parses or retrieves all the attributes found in a class
publicCollectiongetConstant(string $className,string $constantName)Returns the attributes found in a specific constant
publicarraygetConstants(string $className)Returns the attributes found in all the class’ constants
publicCollectiongetMethod(string $className,string $methodName)Returns the attributes found in a specific method
publicarraygetMethods(string $className)Returns the attributes found in all the class’ methods
publicarraygetProperties(string $className)Returns the attributes found in all the class’ properties
publicCollectiongetProperty(string $className,string $propertyName)Returns the attributes found in a specific property
publicReaderInterfacegetReader()Returns the annotation reader
publicbool|Reflectionread(string $key)Reads parsed annotations from memory
publicvoidsetReader(ReaderInterface $reader)Sets the attributes parser
publicboolwrite(string $key,Reflection $data)Writes parsed annotations to memory
Constants
stringCACHE_PREFIX = "_PHATN"Properties
protectedAdapterInterface$adapterprotectedarray$attributes = []protectedReader|null$reader = nullMethods
__construct()
public function __construct( AdapterInterface $adapter );get()
public function get( mixed $className ): Reflection;Parses or retrieves all the attributes found in a class
getConstant()
public function getConstant(
string $className,
string $constantName
): Collection;Returns the attributes found in a specific constant
getConstants()
public function getConstants( string $className ): array;Returns the attributes found in all the class’ constants
getMethod()
public function getMethod(
string $className,
string $methodName
): Collection;Returns the attributes found in a specific method
getMethods()
public function getMethods( string $className ): array;Returns the attributes found in all the class’ methods
getProperties()
public function getProperties( string $className ): array;Returns the attributes found in all the class’ properties
getProperty()
public function getProperty(
string $className,
string $propertyName
): Collection;Returns the attributes found in a specific property
getReader()
public function getReader(): ReaderInterface;Returns the annotation reader
read()
public function read( string $key ): bool|Reflection;Reads parsed annotations from memory
setReader()
public function setReader( ReaderInterface $reader ): void;Sets the attributes parser
write()
public function write(
string $key,
Reflection $data
): bool;Writes parsed annotations to memory
Annotations\Models\MetaData\Column
ClassSource on GitHubPhalcon\Annotations\Models\MetaData\Column
Uses Attribute
Method Summary
Properties
publicbool$allowEmptyString = falsepublicstring|null$column = nullpublicmixed$default = nullpublicint|null$length = nullpublicbool$nullable = falsepublicbool$skipOnInsert = falsepublicbool$skipOnUpdate = falsepublicstring$type = "string"Methods
__construct()
public function __construct(
string|null $column = null,
string $type = "string",
int|null $length = null,
bool $nullable = false,
bool $skipOnInsert = false,
bool $skipOnUpdate = false,
bool $allowEmptyString = false,
mixed $default = null
);Annotations\Models\MetaData\Identity
ClassSource on GitHubPhalcon\Annotations\Models\MetaData\Identity
Uses Attribute
Annotations\Models\MetaData\Primary
ClassSource on GitHubPhalcon\Annotations\Models\MetaData\Primary
Uses Attribute
Annotations\Models\MetaData\Source
ClassSource on GitHubPhalcon\Annotations\Models\MetaData\Source
Uses Attribute
Method Summary
Properties
publicstring$tableMethods
__construct()
public function __construct( string $table );Annotations\Parser\Annotation
ClassSource on GitHubRepresents a single attribute in an attributes collection
Phalcon\Annotations\Parser\Annotation
Uses ReflectionAttribute
Method Summary
public__construct(ReflectionAttribute $reflectionData)Constructor
publicmixedgetArgument(int|string $position)Returns an argument in a specific position
publicarraygetArguments()Returns the expression arguments
publicstringgetCleanName()Returns the attribute’s base name
publicstringgetName()Returns the attribute’s name
publicmixedgetNamedArgument(string $name)Returns a named argument
publicmixedgetNamedParameter(string $name)Returns a named parameter
publicboolhasArgument(int|string $position)Returns an argument in a specific position
publicintnumberArguments()Returns the number of arguments that the attribute has
Properties
protectedarray$arguments = []Attribute Arguments
protectedstring$nameAttribute Name
Methods
__construct()
public function __construct( ReflectionAttribute $reflectionData );Constructor
getArgument()
public function getArgument( int|string $position ): mixed;Returns an argument in a specific position
getArguments()
public function getArguments(): array;Returns the expression arguments
getCleanName()
public function getCleanName(): string;Returns the attribute’s base name
getName()
public function getName(): string;Returns the attribute’s name
getNamedArgument()
public function getNamedArgument( string $name ): mixed;Returns a named argument
getNamedParameter()
public function getNamedParameter( string $name ): mixed;Returns a named parameter
hasArgument()
public function hasArgument( int|string $position ): bool;Returns an argument in a specific position
numberArguments()
public function numberArguments(): int;Returns the number of arguments that the attribute has
Annotations\Parser\Collection
ClassSource on GitHubRepresents a collection of annotations. This class allows to traverse a group of annotations easily
// Traverse annotations
foreach ($classAnnotations as $annotation) {
echo "Name=", $annotation->getName(), PHP_EOL;
}
// Check if the annotations has a specific
var_dump($classAnnotations->has("Cacheable"));
// Get an specific annotation in the collection
$annotation = $classAnnotations->get("Cacheable");
@template TKey of int
@template TValue of AnnotationPhalcon\Annotations\Parser\Collection- implements\IteratorAggregate
Uses ArrayIterator · IteratorAggregate · Traversable
Method Summary
public__construct(array $reflectionData = [])Constructor
publicAnnotationget(string $name)Returns the first annotation that match a name
publicarraygetAll(string $name)Returns all the annotations that match a name
publicTraversablegetAnnotations()publicTraversablegetIterator()publicboolhas(string $name)Check if an annotation exists in a collection
Properties
protectedarray$annotationsprotectedint$position = 0Methods
__construct()
public function __construct( array $reflectionData = [] );Constructor
get()
public function get( string $name ): Annotation;Returns the first annotation that match a name
getAll()
public function getAll( string $name ): array;Returns all the annotations that match a name
getAnnotations()
public function getAnnotations(): Traversable;getIterator()
public function getIterator(): Traversable;has()
public function has( string $name ): bool;Check if an annotation exists in a collection
Annotations\Parser\Exception
ClassSource on GitHubClass for exceptions thrown by Phalcon\Annotations
\ExceptionPhalcon\Annotations\Parser\Exception
Annotations\Parser\Reader
ClassSource on GitHubParses classes returning an array with the found annotations
Phalcon\Annotations\Parser\Reader- implementsPhalcon\Annotations\Parser\ReaderInterface
Uses ReflectionClass · ReflectionException
Method Summary
Methods
parse()
public function parse( string $className ): array;Reads annotations from the class, its methods and/or properties
Annotations\Parser\ReaderInterface
InterfaceSource on GitHubParses attributes returning an array with the found attributes
Phalcon\Annotations\Parser\ReaderInterface
Method Summary
Methods
parse()
public function parse( string $className ): array;Reads attributes from the class, properties and methods
Annotations\Parser\Reflection
ClassSource on GitHubAllows to manipulate the annotations reflection in an OO manner
use Phalcon\Components\Annotations\Reader;
use Phalcon\Components\Annotations\Reflection;
// Parse the annotations in a class
$reader = new Reader();
$parsing = $reader->parse("MyComponent");
// Create the reflection
$reflection = new Reflection($parsing);
// Get the annotations from the class
$classAnnotations = $reflection->getClassAnnotations();Phalcon\Annotations\Parser\Reflection
Method Summary
public__construct(array $reflectionData = [])Constructor
publicCollection|nullgetClassAnnotations()Returns the annotations found in the class docblock
publicarraygetConstantsAnnotations()Returns the annotations found as constants
publicarraygetMethodsAnnotations()Returns the annotations found at methods
publicarraygetPropertiesAnnotations()Returns the annotations found at properties
publicarraygetReflectionData()Returns the raw parsing intermediate definitions used to construct the
Properties
protectedCollection|null$classAnnotations = nullprotectedarray$constantAnnotations = []protectedarray$methodAnnotations = []protectedarray$propertyAnnotations = []protectedarray$reflectionData = []Methods
__construct()
public function __construct( array $reflectionData = [] );Constructor
getClassAnnotations()
public function getClassAnnotations(): Collection|null;Returns the annotations found in the class docblock
getConstantsAnnotations()
public function getConstantsAnnotations(): array;Returns the annotations found as constants
getMethodsAnnotations()
public function getMethodsAnnotations(): array;Returns the annotations found at methods
getPropertiesAnnotations()
public function getPropertiesAnnotations(): array;Returns the annotations found at properties
getReflectionData()
public function getReflectionData(): array;Returns the raw parsing intermediate definitions used to construct the reflection
Annotations\Router\Connect
ClassSource on GitHubPhalcon\Annotations\Router\RoutePhalcon\Annotations\Router\Connect
Uses Attribute · Phalcon\Http\Message\RequestMethodInterface
Method Summary
Methods
__construct()
public function __construct( mixed $params );Annotations\Router\Delete
ClassSource on GitHubPhalcon\Annotations\Router\RoutePhalcon\Annotations\Router\Delete
Uses Attribute · Phalcon\Http\Message\RequestMethodInterface
Method Summary
Methods
__construct()
public function __construct( mixed $params );Annotations\Router\Get
ClassSource on GitHubPhalcon\Annotations\Router\RoutePhalcon\Annotations\Router\Get
Uses Attribute · Phalcon\Http\Message\RequestMethodInterface
Method Summary
Methods
__construct()
public function __construct( mixed $params );Annotations\Router\Head
ClassSource on GitHubPhalcon\Annotations\Router\RoutePhalcon\Annotations\Router\Head
Uses Attribute · Phalcon\Http\Message\RequestMethodInterface
Method Summary
Methods
__construct()
public function __construct( mixed $params );Annotations\Router\Options
ClassSource on GitHubPhalcon\Annotations\Router\RoutePhalcon\Annotations\Router\Options
Uses Attribute · Phalcon\Http\Message\RequestMethodInterface
Method Summary
Methods
__construct()
public function __construct( mixed $params );Annotations\Router\Patch
ClassSource on GitHubPhalcon\Annotations\Router\RoutePhalcon\Annotations\Router\Patch
Uses Attribute · Phalcon\Http\Message\RequestMethodInterface
Method Summary
Methods
__construct()
public function __construct( mixed $params );Annotations\Router\Post
ClassSource on GitHubPhalcon\Annotations\Router\RoutePhalcon\Annotations\Router\Post
Uses Attribute · Phalcon\Http\Message\RequestMethodInterface
Method Summary
Methods
__construct()
public function __construct( mixed $params );Annotations\Router\Purge
ClassSource on GitHubPhalcon\Annotations\Router\RoutePhalcon\Annotations\Router\Purge
Uses Attribute · Phalcon\Http\Message\RequestMethodInterface
Method Summary
Methods
__construct()
public function __construct( mixed $params );Annotations\Router\Put
ClassSource on GitHubPhalcon\Annotations\Router\RoutePhalcon\Annotations\Router\Put
Uses Attribute · Phalcon\Http\Message\RequestMethodInterface
Method Summary
Methods
__construct()
public function __construct( mixed $params );Annotations\Router\Route
ClassSource on GitHubPhalcon\Annotations\Router\RoutePhalcon\Annotations\Router\ConnectPhalcon\Annotations\Router\DeletePhalcon\Annotations\Router\GetPhalcon\Annotations\Router\HeadPhalcon\Annotations\Router\OptionsPhalcon\Annotations\Router\PatchPhalcon\Annotations\Router\PostPhalcon\Annotations\Router\PurgePhalcon\Annotations\Router\PutPhalcon\Annotations\Router\Trace
Uses Attribute · Phalcon\Http\Message\RequestMethodInterface
Method Summary
Properties
publicarray|string|null$beforeMatch = nullpublicarray$converters = []publicarray|string$methods = [...]publicstring|null$name = nullpublicarray$paths = []publicstring$routeMethods
__construct()
public function __construct(
string $route,
array|string $methods = [...],
string|null $name = null,
array $paths = [],
array $converters = [],
array|string|null $beforeMatch = null
);Annotations\Router\RoutePrefix
ClassSource on GitHubPhalcon\Annotations\Router\RoutePrefix
Uses Attribute
Method Summary
Properties
publicstring$prefixMethods
__construct()
public function __construct( string $prefix );Annotations\Router\Trace
ClassSource on GitHubPhalcon\Annotations\Router\RoutePhalcon\Annotations\Router\Trace
Uses Attribute · Phalcon\Http\Message\RequestMethodInterface
Method Summary
Methods
__construct()
public function __construct( mixed $params );