PHP Класс Sulu\Component\Rest\Listing\ListRestHelper

These values are calculated from the request paramaters. For lists it allocates a Repository
Устаревший:
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$em Doctrine\Common\Persistence\ObjectManager
$request Symfony\Component\HttpFoundation\Request The current request object.

Открытые методы

Метод Описание
__construct ( Request $request, Doctrine\Common\Persistence\ObjectManager $em ) The constructor takes the request as an argument, which is injected by the service container.
find ( string $entityName, array $where = [], array $joinConditions = [] ) : array Create a ListRepository for given EntityName and find Entities for list.
getAllFields ( $entityName ) : array returns all field names for a certain entity.
getFields ( ) : array | null Returns an array with all the fields, which should be contained in the response.
getLimit ( ) : integer Returns the maximum number of elements in a single response.
getOffset ( ) : integer | null Returns the calculated value for the starting position based on the page and limit values.
getPage ( ) : mixed returns the current page.
getRepository ( string $entityName ) : ListRepository Create a ListRepository for given EntityName.
getSearchFields ( ) : array | null Returns an array with all the fields the search pattern should be executed on.
getSearchPattern ( ) : mixed Returns the pattern of the search.
getSorting ( ) : array Returns an array containing the desired sorting.
getTotalNumberOfElements ( $entityName, $where, array $joinConditions = [] ) : integer
getTotalPages ( integer $totalNumber = null ) : float | integer returns total amount of pages.

Защищенные методы

Метод Описание
getRequest ( ) : Request Returns the current Request.

Описание методов

__construct() публичный Метод

The constructor takes the request as an argument, which is injected by the service container.
public __construct ( Request $request, Doctrine\Common\Persistence\ObjectManager $em )
$request Symfony\Component\HttpFoundation\Request
$em Doctrine\Common\Persistence\ObjectManager

find() публичный Метод

Create a ListRepository for given EntityName and find Entities for list.
public find ( string $entityName, array $where = [], array $joinConditions = [] ) : array
$entityName string
$where array
$joinConditions array
Результат array

getAllFields() публичный Метод

returns all field names for a certain entity.
public getAllFields ( $entityName ) : array
$entityName
Результат array

getFields() публичный Метод

If null is returned every field should be contained.
public getFields ( ) : array | null
Результат array | null

getLimit() публичный Метод

Returns the maximum number of elements in a single response.
public getLimit ( ) : integer
Результат integer

getOffset() публичный Метод

Returns the calculated value for the starting position based on the page and limit values.
public getOffset ( ) : integer | null
Результат integer | null

getPage() публичный Метод

returns the current page.
public getPage ( ) : mixed
Результат mixed

getRepository() публичный Метод

Create a ListRepository for given EntityName.
public getRepository ( string $entityName ) : ListRepository
$entityName string
Результат ListRepository

getRequest() защищенный Метод

Returns the current Request.
protected getRequest ( ) : Request
Результат Symfony\Component\HttpFoundation\Request

getSearchFields() публичный Метод

Returns an array with all the fields the search pattern should be executed on.
public getSearchFields ( ) : array | null
Результат array | null

getSearchPattern() публичный Метод

Returns the pattern of the search.
public getSearchPattern ( ) : mixed
Результат mixed

getSorting() публичный Метод

Returns an array containing the desired sorting.
public getSorting ( ) : array
Результат array

getTotalNumberOfElements() публичный Метод

public getTotalNumberOfElements ( $entityName, $where, array $joinConditions = [] ) : integer
$entityName
$where
$joinConditions array
Результат integer

getTotalPages() публичный Метод

returns total amount of pages.
public getTotalPages ( integer $totalNumber = null ) : float | integer
$totalNumber integer if not defined the total number is requested from DB
Результат float | integer

Описание свойств

$em защищенное свойство

protected ObjectManager,Doctrine\Common\Persistence $em
Результат Doctrine\Common\Persistence\ObjectManager

$request защищенное свойство

The current request object.
protected Request,Symfony\Component\HttpFoundation $request
Результат Symfony\Component\HttpFoundation\Request