PHP Class YetORM\Repository

Inheritance: extends Nette\Object
Show file Open project: uestla/yetorm Class Usage Examples

Protected Properties

Property Type Description
$database Nette\Database\Context
$entity string
$table string

Public Methods

Method Description
__call ( string $name, array $args ) : mixed
__construct ( Context $database )
createEntity ( ActiveRow | Record $row = NULL ) : Entity
delete ( Entity $entity ) : boolean
findAll ( ) : EntityCollection
findBy ( array $criteria ) : EntityCollection
getBy ( array $criteria ) : Entity | null
getByID ( mixed $id ) : Entity | null
persist ( Entity $entity ) : boolean

Protected Methods

Method Description
checkEntity ( Entity $entity ) : void
createCollection ( Selection $selection, string | callable $entity = NULL, string $refTable = NULL, string $refColumn = NULL ) : EntityCollection
createEntityFromSelection ( Selection $selection ) : Entity | null
getEntityClass ( ) : string
getTable ( string $table = NULL ) : Selection
getTableName ( ) : string
handleException ( Exception $e ) : void
transaction ( Closure $callback ) : mixed

Method Details

__call() public method

public __call ( string $name, array $args ) : mixed
$name string
$args array
return mixed

__construct() public method

public __construct ( Context $database )
$database Nette\Database\Context

checkEntity() final protected method

final protected checkEntity ( Entity $entity ) : void
$entity Entity
return void

createCollection() protected method

protected createCollection ( Selection $selection, string | callable $entity = NULL, string $refTable = NULL, string $refColumn = NULL ) : EntityCollection
$selection Nette\Database\Table\Selection
$entity string | callable
$refTable string
$refColumn string
return EntityCollection

createEntity() public method

public createEntity ( ActiveRow | Record $row = NULL ) : Entity
$row Nette\Database\Table\ActiveRow | Record
return Entity

createEntityFromSelection() protected method

protected createEntityFromSelection ( Selection $selection ) : Entity | null
$selection Nette\Database\Table\Selection
return Entity | null

delete() public method

public delete ( Entity $entity ) : boolean
$entity Entity
return boolean

findAll() public method

public findAll ( ) : EntityCollection
return EntityCollection

findBy() public method

public findBy ( array $criteria ) : EntityCollection
$criteria array
return EntityCollection

getBy() public method

public getBy ( array $criteria ) : Entity | null
$criteria array
return Entity | null

getByID() public method

public getByID ( mixed $id ) : Entity | null
$id mixed
return Entity | null

getEntityClass() final protected method

final protected getEntityClass ( ) : string
return string

getTable() protected method

protected getTable ( string $table = NULL ) : Selection
$table string
return Nette\Database\Table\Selection

getTableName() final protected method

final protected getTableName ( ) : string
return string

handleException() protected method

protected handleException ( Exception $e ) : void
$e Exception
return void

persist() public method

public persist ( Entity $entity ) : boolean
$entity Entity
return boolean

transaction() final protected method

final protected transaction ( Closure $callback ) : mixed
$callback Closure
return mixed

Property Details

$database protected property

protected Context,Nette\Database $database
return Nette\Database\Context

$entity protected property

protected string $entity
return string

$table protected property

protected string $table
return string