PHP 클래스 Doctrine\Common\Proxy\ProxyGenerator

It builds proxies from given parameters, a template and class metadata.
부터: 2.4
저자: Marco Pivetta ([email protected])
파일 보기 프로젝트 열기: doctrine/common 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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