PHP Класс Doctrine\Common\Proxy\ProxyGenerator

It builds proxies from given parameters, a template and class metadata.
С версии: 2.4
Автор: Marco Pivetta ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$placeholders string[] | callable[] Map of callables used to fill in placeholders set in the template.
$proxyClassTemplate string Template used as a blueprint to generate proxies.

Открытые методы

Метод Описание
__construct ( string $proxyDirectory, string $proxyNamespace ) Initializes a new instance of the ProxyFactory class that is connected to the given EntityManager.
generateProxyClass ( Doctrine\Common\Persistence\Mapping\ClassMetadata $class, string | boolean $fileName = false ) Generates a proxy class file.
getProxyFileName ( string $className, string $baseDirectory = null ) : string Generates the Proxy file name.
setPlaceholder ( string $name, string | callable $placeholder ) Sets a placeholder to be replaced in the template.
setProxyClassTemplate ( string $proxyClassTemplate ) Sets the base template used to create proxy classes.

Приватные методы

Метод Описание
buildParametersString ( Doctrine\Common\Persistence\Mapping\ClassMetadata $class, ReflectionMethod $method, array $parameters ) : string
formatType ( ReflectionType $type, ReflectionMethod $method, ReflectionParameter $parameter = null ) : string
generateClassName ( Doctrine\Common\Persistence\Mapping\ClassMetadata $class ) : string Generates the original class name.
generateCloneImpl ( Doctrine\Common\Persistence\Mapping\ClassMetadata $class ) : string Generates implementation for the __clone method of proxies.
generateConstructorImpl ( Doctrine\Common\Persistence\Mapping\ClassMetadata $class ) : string Generates the constructor code (un-setting public lazy loaded properties, setting identifier field values).
generateLazyPropertiesDefaults ( Doctrine\Common\Persistence\Mapping\ClassMetadata $class ) : string Generates the array representation of lazy loaded public properties and their default values.
generateMagicGet ( Doctrine\Common\Persistence\Mapping\ClassMetadata $class ) : string Generates the magic getter invoked when lazy loaded public properties are requested.
generateMagicIsset ( Doctrine\Common\Persistence\Mapping\ClassMetadata $class ) : string Generates the magic issetter invoked when lazy loaded public properties are checked against isset().
generateMagicSet ( Doctrine\Common\Persistence\Mapping\ClassMetadata $class ) : string Generates the magic setter (currently unused).
generateMethods ( Doctrine\Common\Persistence\Mapping\ClassMetadata $class ) : string Generates decorated methods by picking those available in the parent class.
generateNamespace ( Doctrine\Common\Persistence\Mapping\ClassMetadata $class ) : string Generates the proxy namespace.
generateProxyShortClassName ( Doctrine\Common\Persistence\Mapping\ClassMetadata $class ) : string Generates the proxy short class name to be used in the template.
generateSleepImpl ( Doctrine\Common\Persistence\Mapping\ClassMetadata $class ) : string Generates implementation for the __sleep method of proxies.
generateWakeupImpl ( Doctrine\Common\Persistence\Mapping\ClassMetadata $class ) : string Generates implementation for the __wakeup method of proxies.
getLazyLoadedPublicProperties ( Doctrine\Common\Persistence\Mapping\ClassMetadata $class ) : mixed[] Generates the list of public properties to be lazy loaded, with their default values.
getMethodReturnType ( ReflectionMethod $method ) : string
getParameterNamesForInvoke ( array $parameters ) : string[]
getParameterNamesForParentCall ( array $parameters ) : string[]
getParameterType ( Doctrine\Common\Persistence\Mapping\ClassMetadata $class, ReflectionMethod $method, ReflectionParameter $parameter ) : string | null
isShortIdentifierGetter ( ReflectionMethod $method, Doctrine\Common\Persistence\Mapping\ClassMetadata $class ) : boolean Checks if the method is a short identifier getter.
shouldProxiedMethodReturn ( ReflectionMethod $method ) : boolean

Описание методов

__construct() публичный Метод

Initializes a new instance of the ProxyFactory class that is connected to the given EntityManager.
public __construct ( string $proxyDirectory, string $proxyNamespace )
$proxyDirectory string The directory to use for the proxy classes. It must exist.
$proxyNamespace string The namespace to use for the proxy classes.

generateProxyClass() публичный Метод

Generates a proxy class file.
public generateProxyClass ( Doctrine\Common\Persistence\Mapping\ClassMetadata $class, string | boolean $fileName = false )
$class Doctrine\Common\Persistence\Mapping\ClassMetadata Metadata for the original class.
$fileName string | boolean Filename (full path) for the generated class. If none is given, eval() is used.

getProxyFileName() публичный Метод

Generates the Proxy file name.
public getProxyFileName ( string $className, string $baseDirectory = null ) : string
$className string
$baseDirectory string Optional base directory for proxy file name generation. If not specified, the directory configured on the Configuration of the EntityManager will be used by this factory.
Результат string

setPlaceholder() публичный Метод

Sets a placeholder to be replaced in the template.
public setPlaceholder ( string $name, string | callable $placeholder )
$name string
$placeholder string | callable

setProxyClassTemplate() публичный Метод

Sets the base template used to create proxy classes.
public setProxyClassTemplate ( string $proxyClassTemplate )
$proxyClassTemplate string

Описание свойств

$placeholders защищенное свойство

Map of callables used to fill in placeholders set in the template.
protected string[]|callable[] $placeholders
Результат string[] | callable[]

$proxyClassTemplate защищенное свойство

Template used as a blueprint to generate proxies.
protected string $proxyClassTemplate
Результат string