Overview

Namespaces

  • LeanMapper
    • Exception
    • Reflection
    • Relationship

Classes

  • Entity
  • Repository
  • Result
  • Row
  • Overview
  • Namespace
  • Class

Class Repository

Base class for custom repositories

Abstract
Namespace: LeanMapper
Author: Vojtěch Kohout
Located at Repository.php
Methods summary
public
# __construct( DibiConnection $connection )

Parameters

$connection
public integer
# persist( LeanMapper\Entity $entity )

Stored modified fields of entity into database and creates new row in database when entity is in detached state

Stored modified fields of entity into database and creates new row in database when entity is in detached state

Parameters

$entity

Returns

integer
public
# delete( LeanMapper\Entity|integer $arg )

Removes given entity (or entity with given id) from database

Removes given entity (or entity with given id) from database

Parameters

$arg

Throws

LeanMapper\Exception\InvalidStateException
protected mixed
# createEntity( DibiRow $row, string|null $entityClass = null, string|null $table = null )

Helps to create entity instance from given DibiRow instance

Helps to create entity instance from given DibiRow instance

Parameters

$row
$entityClass
$table

Returns

mixed
protected array
# createEntities( array $rows, string|null $entityClass = null, string|null $table = null )

Helps to create array of entites from given array of DibiRow instances

Helps to create array of entites from given array of DibiRow instances

Parameters

$rows
$entityClass
$table

Returns

array
protected string
# getTable( )

Returns name of database table related to entity which repository can handle

Returns name of database table related to entity which repository can handle

Returns

string

Throws

LeanMapper\Exception\InvalidStateException
protected string
# getEntityClass( )

Returns fully qualified name of entity class which repository can handle

Returns fully qualified name of entity class which repository can handle

Returns

string

Throws

LeanMapper\Exception\InvalidStateException
Properties summary
public static string $defaultEntityNamespace

Varstring

# 'Model\Entity'
protected DibiConnection $connection
#
protected string $table
#
protected string $entityClass
#
tharos/leanmapper v1.3.0 API documentation API documentation generated by ApiGen