PHP Class Nextras\Orm\Model\Model

Inheritance: extends Nette\Object, implements Nextras\Orm\Model\IModel
Show file Open project: nextras/orm Class Usage Examples

Public Properties

Property Type Description
$onFlush of callbacks with (IEntity[] $persisted, IEntity $removed) arguments

Public Methods

Method Description
__construct ( array $configuration, Nextras\Orm\Model\IRepositoryLoader $repositoryLoader, MetadataStorage $metadataStorage )
__get ( string $name ) : Nextras\Orm\Repository\IRepository Returns repository by name.
clearIdentityMapAndCaches ( $areYouSure )
flush ( )
getConfiguration ( array $repositories ) : array Creates repository list configuration.
getMetadataStorage ( )
getRepository ( $className )
getRepositoryByName ( $name )
getRepositoryForEntity ( $entity )
hasRepository ( $className )
hasRepositoryByName ( $name )
persist ( Nextras\Orm\Entity\IEntity $entity, $withCascade = true )
persistAndFlush ( Nextras\Orm\Entity\IEntity $entity )
remove ( Nextras\Orm\Entity\IEntity $entity, $withCascade = true )

Private Methods

Method Description
getLoadedRepositories ( ) : Nextras\Orm\Repository\IRepository[]

Method Details

__construct() public method

public __construct ( array $configuration, Nextras\Orm\Model\IRepositoryLoader $repositoryLoader, MetadataStorage $metadataStorage )
$configuration array
$repositoryLoader Nextras\Orm\Model\IRepositoryLoader
$metadataStorage MetadataStorage

__get() public method

Returns repository by name.
public __get ( string $name ) : Nextras\Orm\Repository\IRepository
$name string
return Nextras\Orm\Repository\IRepository

clearIdentityMapAndCaches() public method

public clearIdentityMapAndCaches ( $areYouSure )

flush() public method

public flush ( )

getConfiguration() public static method

Creates repository list configuration.
public static getConfiguration ( array $repositories ) : array
$repositories array
return array

getMetadataStorage() public method

public getMetadataStorage ( )

getRepository() public method

public getRepository ( $className )

getRepositoryByName() public method

public getRepositoryByName ( $name )

getRepositoryForEntity() public method

public getRepositoryForEntity ( $entity )

hasRepository() public method

public hasRepository ( $className )

hasRepositoryByName() public method

public hasRepositoryByName ( $name )

persist() public method

public persist ( Nextras\Orm\Entity\IEntity $entity, $withCascade = true )
$entity Nextras\Orm\Entity\IEntity

persistAndFlush() public method

public persistAndFlush ( Nextras\Orm\Entity\IEntity $entity )
$entity Nextras\Orm\Entity\IEntity

remove() public method

public remove ( Nextras\Orm\Entity\IEntity $entity, $withCascade = true )
$entity Nextras\Orm\Entity\IEntity

Property Details

$onFlush public property

of callbacks with (IEntity[] $persisted, IEntity $removed) arguments
public $onFlush