PHP 클래스 FactoryGirl\Provider\Doctrine\FixtureFactory

See the README file for a tutorial.
파일 보기 프로젝트 열기: breerly/factory-girl-php 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$em Doctrine\ORM\EntityManager
$entityDefs array
$entityNamespace string
$persist boolean
$singletons array

공개 메소드들

메소드 설명
__construct ( EntityManager $em )
defineEntity ( $name, array $fieldDefs = [], array $config = [] ) : FixtureFactory Defines how to create a default entity of type $name.
get ( $name, array $fieldOverrides = [] ) Get an entity and its dependencies.
getAsSingleton ( $name, array $fieldOverrides = [] ) A shorthand combining get() and setSingleton().
getEntityNamespace ( )
getList ( $name, array $fieldOverrides = [], $numberOfInstances = 1 ) Get an array of entities and their dependencies.
persistOnGet ( $enabled = true ) Sets whether get() should automatically persist the entity it creates.
setEntityNamespace ( $namespace ) Sets the namespace to be prefixed to all entity names passed to this class.
setSingleton ( $name, $entity ) Sets $entity to be the singleton for $name.
unsetSingleton ( $name ) Unsets the singleton for $name.

보호된 메소드들

메소드 설명
addNamespace ( string $name ) : string
checkFieldOverrides ( EntityDef $def, array $fieldOverrides )
createCollectionFrom ( $array = [] )
setField ( $ent, EntityDef $def, $fieldName, $fieldValue )
updateCollectionSideOfAssocation ( $entityBeingCreated, $metadata, $fieldName, $value )

메소드 상세

__construct() 공개 메소드

public __construct ( EntityManager $em )
$em Doctrine\ORM\EntityManager

addNamespace() 보호된 메소드

protected addNamespace ( string $name ) : string
$name string
리턴 string

checkFieldOverrides() 보호된 메소드

protected checkFieldOverrides ( EntityDef $def, array $fieldOverrides )
$def EntityDef
$fieldOverrides array

createCollectionFrom() 보호된 메소드

protected createCollectionFrom ( $array = [] )

defineEntity() 공개 메소드

See the readme for a tutorial.
public defineEntity ( $name, array $fieldDefs = [], array $config = [] ) : FixtureFactory
$fieldDefs array
$config array
리턴 FixtureFactory

get() 공개 메소드

Whether the entity is new or not depends on whether you've created a singleton with the entity name. See getAsSingleton(). If you've called persistOnGet() then the entity is also persisted.
public get ( $name, array $fieldOverrides = [] )
$fieldOverrides array

getAsSingleton() 공개 메소드

It's illegal to call this if $name already has a singleton.
public getAsSingleton ( $name, array $fieldOverrides = [] )
$fieldOverrides array

getEntityNamespace() 공개 메소드

public getEntityNamespace ( )

getList() 공개 메소드

Whether the entities are new or not depends on whether you've created a singleton with the entity name. See getAsSingleton(). If you've called persistOnGet() then the entities are also persisted.
public getList ( $name, array $fieldOverrides = [], $numberOfInstances = 1 )
$fieldOverrides array

persistOnGet() 공개 메소드

By default it does not. In any case, you still need to call flush() yourself.
public persistOnGet ( $enabled = true )

setEntityNamespace() 공개 메소드

Sets the namespace to be prefixed to all entity names passed to this class.
public setEntityNamespace ( $namespace )

setField() 보호된 메소드

protected setField ( $ent, EntityDef $def, $fieldName, $fieldValue )
$def EntityDef

setSingleton() 공개 메소드

This causes get($name) to return $entity.
public setSingleton ( $name, $entity )

unsetSingleton() 공개 메소드

This causes get($name) to return new entities again.
public unsetSingleton ( $name )

updateCollectionSideOfAssocation() 보호된 메소드

protected updateCollectionSideOfAssocation ( $entityBeingCreated, $metadata, $fieldName, $value )

프로퍼티 상세

$em 보호되어 있는 프로퍼티

protected EntityManager,Doctrine\ORM $em
리턴 Doctrine\ORM\EntityManager

$entityDefs 보호되어 있는 프로퍼티

protected array $entityDefs
리턴 array

$entityNamespace 보호되어 있는 프로퍼티

protected string $entityNamespace
리턴 string

$persist 보호되어 있는 프로퍼티

protected bool $persist
리턴 boolean

$singletons 보호되어 있는 프로퍼티

protected array $singletons
리턴 array