PHP Interface Nextras\Orm\Repository\IRepository

Exibir arquivo Open project: nextras/orm Interface Usage Examples

Public Methods

Method Description
attach ( Nextras\Orm\Entity\IEntity $entity ) Attaches entity to repository.
detach ( Nextras\Orm\Entity\IEntity $entity ) Detaches entity from repository.
doClearIdentityMap ( $areYouSure ) DO NOT CALL THIS METHOD DIRECTLY.
doFireEvent ( Nextras\Orm\Entity\IEntity $entity, string $event ) : void DO NOT CALL THIS METHOD DIRECTLY.
doFlush ( ) : [IEntity[], DO NOT CALL THIS METHOD DIRECTLY.
doPersist ( Nextras\Orm\Entity\IEntity $entity ) DO NOT CALL THIS METHOD DIRECTLY.
doRemove ( Nextras\Orm\Entity\IEntity $entity ) DO NOT CALL THIS METHOD DIRECTLY.
findAll ( ) : Nextras\Orm\Collection\ICollection Returns entity collection with all entities.
findBy ( array $where ) : Nextras\Orm\Collection\ICollection Returns entity collection filtered by conditions.
findById ( mixed[] $primaryValues ) : Nextras\Orm\Collection\ICollection Returns entities by primary values.
flush ( ) Flushes all persisted changes in all repositories.
getBy ( array $conds ) : Nextras\Orm\Entity\IEntity | null Returns IEntity filtered by conditions
getById ( mixed $primaryValue ) : Nextras\Orm\Entity\IEntity Returns entity by primary value.
getEntityClassName ( array $data ) : string Returns entity class name.
getEntityClassNames ( ) : string[] Returns possible entity class names for current repository.
getEntityMetadata ( ) : EntityMetadata Returns entity metadata.
getMapper ( ) : Nextras\Orm\Mapper\IMapper
getModel ( boolean $need = true ) : Nextras\Orm\Model\IModel
hydrateEntity ( array $data ) : Nextras\Orm\Entity\IEntity Hydrates entity.
persist ( Nextras\Orm\Entity\IEntity $entity, boolean $withCascade = true ) : mixed
persistAndFlush ( Nextras\Orm\Entity\IEntity $entity, boolean $withCascade = true ) : mixed
remove ( Nextras\Orm\Entity\IEntity | mixed $entity, boolean $withCascade = true ) : Nextras\Orm\Entity\IEntity
removeAndFlush ( Nextras\Orm\Entity\IEntity | mixed $entity, boolean $withCascade = true ) : Nextras\Orm\Entity\IEntity
setModel ( Nextras\Orm\Model\IModel $model )

Method Details

attach() public method

Attaches entity to repository.
public attach ( Nextras\Orm\Entity\IEntity $entity )
$entity Nextras\Orm\Entity\IEntity

detach() public method

Detaches entity from repository.
public detach ( Nextras\Orm\Entity\IEntity $entity )
$entity Nextras\Orm\Entity\IEntity

doClearIdentityMap() public method

DO NOT CALL THIS METHOD DIRECTLY.
public doClearIdentityMap ( $areYouSure )

doFireEvent() public method

Fires the event on the entity.
public doFireEvent ( Nextras\Orm\Entity\IEntity $entity, string $event ) : void
$entity Nextras\Orm\Entity\IEntity
$event string
return void

doFlush() public method

DO NOT CALL THIS METHOD DIRECTLY.
public doFlush ( ) : [IEntity[],
return [IEntity[],

doPersist() public method

DO NOT CALL THIS METHOD DIRECTLY.
public doPersist ( Nextras\Orm\Entity\IEntity $entity )
$entity Nextras\Orm\Entity\IEntity

doRemove() public method

DO NOT CALL THIS METHOD DIRECTLY.
public doRemove ( Nextras\Orm\Entity\IEntity $entity )
$entity Nextras\Orm\Entity\IEntity

findAll() public method

Returns entity collection with all entities.
public findAll ( ) : Nextras\Orm\Collection\ICollection
return Nextras\Orm\Collection\ICollection

findBy() public method

Returns entity collection filtered by conditions.
public findBy ( array $where ) : Nextras\Orm\Collection\ICollection
$where array
return Nextras\Orm\Collection\ICollection

findById() public method

Returns entities by primary values.
public findById ( mixed[] $primaryValues ) : Nextras\Orm\Collection\ICollection
$primaryValues mixed[]
return Nextras\Orm\Collection\ICollection

flush() public method

Flushes all persisted changes in all repositories.
public flush ( )

getBy() public method

Returns IEntity filtered by conditions
public getBy ( array $conds ) : Nextras\Orm\Entity\IEntity | null
$conds array
return Nextras\Orm\Entity\IEntity | null

getById() public method

Returns entity by primary value.
public getById ( mixed $primaryValue ) : Nextras\Orm\Entity\IEntity
$primaryValue mixed
return Nextras\Orm\Entity\IEntity

getEntityClassName() public method

Returns entity class name.
public getEntityClassName ( array $data ) : string
$data array
return string

getEntityClassNames() public static method

Returns possible entity class names for current repository.
public static getEntityClassNames ( ) : string[]
return string[]

getEntityMetadata() public method

Returns entity metadata.
public getEntityMetadata ( ) : EntityMetadata
return Nextras\Orm\Entity\Reflection\EntityMetadata

getMapper() public method

public getMapper ( ) : Nextras\Orm\Mapper\IMapper
return Nextras\Orm\Mapper\IMapper

getModel() public method

public getModel ( boolean $need = true ) : Nextras\Orm\Model\IModel
$need boolean
return Nextras\Orm\Model\IModel

hydrateEntity() public method

Hydrates entity.
public hydrateEntity ( array $data ) : Nextras\Orm\Entity\IEntity
$data array
return Nextras\Orm\Entity\IEntity

persist() public method

public persist ( Nextras\Orm\Entity\IEntity $entity, boolean $withCascade = true ) : mixed
$entity Nextras\Orm\Entity\IEntity
$withCascade boolean
return mixed

persistAndFlush() public method

public persistAndFlush ( Nextras\Orm\Entity\IEntity $entity, boolean $withCascade = true ) : mixed
$entity Nextras\Orm\Entity\IEntity
$withCascade boolean
return mixed

remove() public method

public remove ( Nextras\Orm\Entity\IEntity | mixed $entity, boolean $withCascade = true ) : Nextras\Orm\Entity\IEntity
$entity Nextras\Orm\Entity\IEntity | mixed
$withCascade boolean
return Nextras\Orm\Entity\IEntity

removeAndFlush() public method

public removeAndFlush ( Nextras\Orm\Entity\IEntity | mixed $entity, boolean $withCascade = true ) : Nextras\Orm\Entity\IEntity
$entity Nextras\Orm\Entity\IEntity | mixed
$withCascade boolean
return Nextras\Orm\Entity\IEntity

setModel() public method

public setModel ( Nextras\Orm\Model\IModel $model )
$model Nextras\Orm\Model\IModel