PHP 클래스 LeanMapper\Repository

저자: Vojtěch Kohout
파일 보기 프로젝트 열기: tharos/leanmapper 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$connection Connection
$entityClass string
$entityFactory leanmapper\IEntityFactory
$events Events
$mapper leanmapper\IMapper
$table string

공개 메소드들

메소드 설명
__construct ( Connection $connection, leanmapper\IMapper $mapper, leanmapper\IEntityFactory $entityFactory )
__get ( string $name ) : array | null
delete ( mixed $arg ) : mixed Removes given entity (or entity with given id) from database
persist ( Entity $entity ) : mixed Stores values of entity's modified properties into database (inserts new row when entity is in detached state)

보호된 메소드들

메소드 설명
checkEntityType ( Entity $entity ) Checks whether give entity is instance of required type
createEntities ( array $rows, string | null $entityClass = null, string | null $table = null ) : array Creates new set of Entity's instances from given array of \Dibi\Row instances
createEntity ( Row $dibiRow, string | null $entityClass = null, string | null $table = null ) : mixed Creates new Entity instance from given \Dibi\Row instance
createFluent ( ) : Fluent
deleteFromDatabase ( mixed $arg ) : mixed Performs database delete (can be customized)
getTable ( ) : string Gets name of (main) database table related to entity that repository can handle
initEvents ( ) Allows initialize repository's events
insertIntoDatabase ( Entity $entity ) : mixed Performs database insert (can be customized)
persistHasManyChanges ( Entity $entity ) Persists changes in M:N relationships
updateInDatabase ( Entity $entity ) : mixed Performs database update (can be customized)

비공개 메소드들

메소드 설명
getDocComment ( ) : string
getIdValue ( Entity $entity ) : mixed

메소드 상세

__construct() 공개 메소드

public __construct ( Connection $connection, leanmapper\IMapper $mapper, leanmapper\IEntityFactory $entityFactory )
$connection Connection
$mapper leanmapper\IMapper
$entityFactory leanmapper\IEntityFactory

__get() 공개 메소드

public __get ( string $name ) : array | null
$name string
리턴 array | null

checkEntityType() 보호된 메소드

Checks whether give entity is instance of required type
protected checkEntityType ( Entity $entity )
$entity Entity

createEntities() 보호된 메소드

Creates new set of Entity's instances from given array of \Dibi\Row instances
protected createEntities ( array $rows, string | null $entityClass = null, string | null $table = null ) : array
$rows array
$entityClass string | null
$table string | null
리턴 array

createEntity() 보호된 메소드

Creates new Entity instance from given \Dibi\Row instance
protected createEntity ( Row $dibiRow, string | null $entityClass = null, string | null $table = null ) : mixed
$dibiRow Dibi\Row
$entityClass string | null
$table string | null
리턴 mixed

createFluent() 보호된 메소드

protected createFluent ( ) : Fluent
리턴 Fluent

delete() 공개 메소드

Removes given entity (or entity with given id) from database
public delete ( mixed $arg ) : mixed
$arg mixed
리턴 mixed

deleteFromDatabase() 보호된 메소드

Performs database delete (can be customized)
protected deleteFromDatabase ( mixed $arg ) : mixed
$arg mixed
리턴 mixed

getTable() 보호된 메소드

Gets name of (main) database table related to entity that repository can handle
protected getTable ( ) : string
리턴 string

initEvents() 보호된 메소드

Allows initialize repository's events
protected initEvents ( )

insertIntoDatabase() 보호된 메소드

Performs database insert (can be customized)
protected insertIntoDatabase ( Entity $entity ) : mixed
$entity Entity
리턴 mixed

persist() 공개 메소드

Stores values of entity's modified properties into database (inserts new row when entity is in detached state)
public persist ( Entity $entity ) : mixed
$entity Entity
리턴 mixed

persistHasManyChanges() 보호된 메소드

Persists changes in M:N relationships
protected persistHasManyChanges ( Entity $entity )
$entity Entity

updateInDatabase() 보호된 메소드

Performs database update (can be customized)
protected updateInDatabase ( Entity $entity ) : mixed
$entity Entity
리턴 mixed

프로퍼티 상세

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

protected Connection,leanmapper $connection
리턴 Connection

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

protected string $entityClass
리턴 string

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

protected IEntityFactory,leanmapper $entityFactory
리턴 leanmapper\IEntityFactory

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

protected Events,leanmapper $events
리턴 Events

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

protected IMapper,leanmapper $mapper
리턴 leanmapper\IMapper

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

protected string $table
리턴 string