PHP 클래스 Symfony\Bridge\Doctrine\Form\ChoiceList\EntityChoiceList

상속: extends Symfony\Component\Form\Extension\Core\ChoiceList\ArrayChoiceList
파일 보기 프로젝트 열기: pmjones/php-framework-benchmarks 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( EntityManager $em, $class, $property = null, $queryBuilder = null, $choices = [] )
getEntities ( ) : array Returns the according entities for the choices
getEntity ( string $key ) : object Returns the entity for the given key
getIdentifier ( )
getIdentifierValues ( object $entity ) Returns the values of the identifier fields of an entity

보호된 메소드들

메소드 설명
load ( ) : array Initializes the choices and returns them

비공개 메소드들

메소드 설명
getReflProperty ( string $property ) : ReflectionProperty Returns the \ReflectionProperty instance for a property of the underlying class
loadEntities ( $entities, $group = null ) Convert entities into choices with support for groups

메소드 상세

__construct() 공개 메소드

public __construct ( EntityManager $em, $class, $property = null, $queryBuilder = null, $choices = [] )
$em Doctrine\ORM\EntityManager

getEntities() 공개 메소드

If the choices were not initialized, they are initialized now. This is an expensive operation, except if the entities were passed in the "choices" option.
public getEntities ( ) : array
리턴 array An array of entities

getEntity() 공개 메소드

If the underlying entities have composite identifiers, the choices are initialized. The key is expected to be the index in the choices array in this case. If they have single identifiers, they are either fetched from the internal entity cache (if filled) or loaded from the database.
public getEntity ( string $key ) : object
$key string The choice key (for entities with composite identifiers) or entity ID (for entities with single identifiers)
리턴 object The matching entity

getIdentifier() 공개 메소드

public getIdentifier ( )

getIdentifierValues() 공개 메소드

Doctrine must know about this entity, that is, the entity must already be persisted or added to the identity map before. Otherwise an exception is thrown.
public getIdentifierValues ( object $entity )
$entity object The entity for which to get the identifier

load() 보호된 메소드

If the entities were passed in the "choices" option, this method does not have any significant overhead. Otherwise, if a query builder was passed in the "query_builder" option, this builder is now used to construct a query which is executed. In the last case, all entities for the underlying class are fetched from the repository.
protected load ( ) : array
리턴 array An array of choices