PHP Class Kdyby\Doctrine\EntityRepository

The first and only rule with EntityRepository is not to ever inherit them, ever. The only valid reason to inherit EntityRepository is to add more common methods to all EntityRepositories in application, when you're creating your own framework (but do we really need to go any deeper than this?).
Author: Filip Procházka ([email protected])
Inheritance: extends Doctrine\ORM\EntityRepository, implements Kdyby\Persistence\QueryExecutor, implements Kdyby\Persistence\Queryable
Datei anzeigen Open project: kdyby/doctrine Class Usage Examples

Public Methods

Method Description
__call ( string $name, array $args ) : mixed Call to undefined method.
__callStatic ( string $name, array $args ) : mixed Call to undefined static method.
__get ( string $name ) : mixed Returns property value. Do not call directly.
__isset ( string $name ) : boolean Is property defined?
__set ( string $name, mixed $value ) : void Sets value of a property. Do not call directly.
__unset ( string $name ) : void Access to undeclared property.
countBy ( array $criteria = [] ) : integer
createNativeQuery ( string $sql, Doctrine\ORM\Query\ResultSetMapping $rsm ) : Doctrine\ORM\NativeQuery
createQuery ( string $dql = NULL ) : Doctrine\ORM\Query
createQueryBuilder ( string $alias = NULL, string $indexBy = NULL ) : Kdyby\Doctrine\QueryBuilder
extensionMethod ( $name, null $callback = NULL ) : callable | null Adding method to class.
fetch ( Kdyby\Persistence\Query $queryObject, integer $hydrationMode = AbstractQuery::HYDRATE_OBJECT ) : array | ResultSet
fetchOne ( Kdyby\Persistence\Query $queryObject ) : object
findAssoc ( array $criteria, string $key = NULL ) : array Fetches all records and returns an associative array indexed by key
findBy ( array $criteria, array $orderBy = null, $limit = null, $offset = null )
findOneBy ( array $criteria, array $orderBy = null )
findPairs ( array $criteria, string $value = NULL, array $orderBy = [], string $key = NULL ) : array Fetches all records like $key => $value pairs
getClassMetadata ( ) : Kdyby\Doctrine\Mapping\ClassMetadata
getEntityManager ( ) : EntityManager
getReference ( integer | array $id ) : Doctrine\ORM\Proxy\Proxy
getReflection ( ) : ClassType Access to reflection.
related ( string $relation ) : EntityRepository

Private Methods

Method Description
criteriaRequiresDql ( array $criteria ) : boolean
handleException ( Exception $e, Doctrine\ORM\Query $query = NULL, string $message = NULL )
handleQueryException ( Exception $e, Kdyby\Persistence\Query $queryObject )

Method Details

__call() public method

Call to undefined method.
public __call ( string $name, array $args ) : mixed
$name string
$args array
return mixed

__callStatic() public static method

Call to undefined static method.
public static __callStatic ( string $name, array $args ) : mixed
$name string
$args array
return mixed

__get() public method

Returns property value. Do not call directly.
public __get ( string $name ) : mixed
$name string
return mixed

__isset() public method

Is property defined?
public __isset ( string $name ) : boolean
$name string
return boolean

__set() public method

Sets value of a property. Do not call directly.
public __set ( string $name, mixed $value ) : void
$name string
$value mixed
return void

__unset() public method

Access to undeclared property.
public __unset ( string $name ) : void
$name string
return void

countBy() public method

public countBy ( array $criteria = [] ) : integer
$criteria array
return integer

createNativeQuery() public method

public createNativeQuery ( string $sql, Doctrine\ORM\Query\ResultSetMapping $rsm ) : Doctrine\ORM\NativeQuery
$sql string
$rsm Doctrine\ORM\Query\ResultSetMapping
return Doctrine\ORM\NativeQuery

createQuery() public method

public createQuery ( string $dql = NULL ) : Doctrine\ORM\Query
$dql string
return Doctrine\ORM\Query

createQueryBuilder() public method

public createQueryBuilder ( string $alias = NULL, string $indexBy = NULL ) : Kdyby\Doctrine\QueryBuilder
$alias string
$indexBy string The index for the from.
return Kdyby\Doctrine\QueryBuilder

extensionMethod() public static method

Adding method to class.
public static extensionMethod ( $name, null $callback = NULL ) : callable | null
$name
$callback null
return callable | null

fetch() public method

public fetch ( Kdyby\Persistence\Query $queryObject, integer $hydrationMode = AbstractQuery::HYDRATE_OBJECT ) : array | ResultSet
$queryObject Kdyby\Persistence\Query
$hydrationMode integer
return array | ResultSet

fetchOne() public method

public fetchOne ( Kdyby\Persistence\Query $queryObject ) : object
$queryObject Kdyby\Persistence\Query
return object

findAssoc() public method

Fetches all records and returns an associative array indexed by key
public findAssoc ( array $criteria, string $key = NULL ) : array
$criteria array
$key string
return array

findBy() public method

public findBy ( array $criteria, array $orderBy = null, $limit = null, $offset = null )
$criteria array
$orderBy array

findOneBy() public method

public findOneBy ( array $criteria, array $orderBy = null )
$criteria array
$orderBy array

findPairs() public method

Fetches all records like $key => $value pairs
public findPairs ( array $criteria, string $value = NULL, array $orderBy = [], string $key = NULL ) : array
$criteria array parameter can be skipped
$value string mandatory
$orderBy array parameter can be skipped
$key string optional
return array

getClassMetadata() public method

public getClassMetadata ( ) : Kdyby\Doctrine\Mapping\ClassMetadata
return Kdyby\Doctrine\Mapping\ClassMetadata

getEntityManager() public method

public getEntityManager ( ) : EntityManager
return EntityManager

getReference() public method

public getReference ( integer | array $id ) : Doctrine\ORM\Proxy\Proxy
$id integer | array
return Doctrine\ORM\Proxy\Proxy

getReflection() public static method

Access to reflection.
public static getReflection ( ) : ClassType
return Nette\Reflection\ClassType