Skip to content

Commit

Permalink
Merge pull request #20 from dealer4dealer/resolve-issue-19
Browse files Browse the repository at this point in the history
Resolve issue 19
  • Loading branch information
AlaaSemsemea authored Mar 23, 2021
2 parents 1d88ab9 + 3eb3c07 commit 8dacfa3
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,23 @@ public function getRepository()

/**
* Get Currencies
*
* @param int $offset
* @param int $limit
* @param array $criteria
* @param array $orderBy
*
* @return array
*/
public function getList(array $criteria = [], array $orderBy = [])
public function getList($offset = 0, $limit = 25, array $criteria = [], array $orderBy = [])
{
$builder = $this->getRepository()->createQueryBuilder('currency');

// Create builder on requested filter and sort
$builder->addFilter($criteria)
->addOrderBy($orderBy);
->addOrderBy($orderBy)
->setFirstResult($offset)
->setMaxResults($limit);

$query = $builder->getQuery();
$query->setHydrationMode($this->resultMode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,23 @@ public function getRepository()

/**
* Get Product Attributes
*
* @param int $offset
* @param int $limit
* @param array $criteria
* @param array $orderBy
*
* @return array
*/
public function getList(array $criteria = [], array $orderBy = [])
public function getList($offset = 0, $limit = 25, array $criteria = [], array $orderBy = [])
{
$builder = $this->getRepository()->createQueryBuilder('filter');

// Create builder on requested filter and sort
$builder->addFilter($criteria)
->addOrderBy($orderBy);
->addOrderBy($orderBy)
->setFirstResult($offset)
->setMaxResults($limit);

$query = $builder->getQuery();
$query->setHydrationMode($this->resultMode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,22 @@ public function getRepository()

/**
* Get order statuses
*
* @param int $offset
* @param int $limit
* @param array $criteria
* @param array $orderBy
* @return array
*/
public function getList(array $criteria = [], array $orderBy = [])
public function getList($offset = 0, $limit = 25, array $criteria = [], array $orderBy = [])
{
$builder = $this->getRepository()->createQueryBuilder('status');

// Create builder on requested filter and sort
$builder->addFilter($criteria)
->addOrderBy($orderBy);
->addOrderBy($orderBy)
->setFirstResult($offset)
->setMaxResults($limit);

$query = $builder->getQuery();
$query->setHydrationMode($this->resultMode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,22 @@ public function getRepository()

/**
* Get order History Data
*
* @param int $offset
* @param int $limit
* @param array $criteria
* @param array $orderBy
* @return array
*/
public function getList(array $criteria = [], array $orderBy = [])
public function getList($offset = 0, $limit = 25, array $criteria = [], array $orderBy = [])
{
$builder = $this->getRepository()->createQueryBuilder('history');

// Create builder on requested filter and sort
$builder->addFilter($criteria)
->addOrderBy($orderBy);
->addOrderBy($orderBy)
->setFirstResult($offset)
->setMaxResults($limit);

$query = $builder->getQuery();
$query->setHydrationMode($this->resultMode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,22 @@ public function getRepository()

/**
* Get Product Attributes
*
* @param int $offset
* @param int $limit
* @param array $criteria
* @param array $orderBy
* @return array
*/
public function getList(array $criteria = [], array $orderBy = [])
public function getList($offset = 0, $limit = 25, array $criteria = [], array $orderBy = [])
{
$builder = $this->getRepository()->createQueryBuilder('filter');

// Create builder on requested filter and sort
$builder->addFilter($criteria)
->addOrderBy($orderBy);
->addOrderBy($orderBy)
->setFirstResult($offset)
->setMaxResults($limit);

$query = $builder->getQuery();
$query->setHydrationMode($this->resultMode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,22 @@ public function getRepository()

/**
* Get options values list
*
* @param int $offset
* @param int $limit
* @param array $criteria
* @param array $orderBy
* @return mixed
*/
public function getList(array $criteria = [], array $orderBy = [])
public function getList($offset = 0, $limit = 25, array $criteria = [], array $orderBy = [])
{
$builder = $this->getRepository()->createQueryBuilder('values');

// Create builder on requested filter and sort
$builder->addFilter($criteria)
->addOrderBy($orderBy);
->addOrderBy($orderBy)
->setFirstResult($offset)
->setMaxResults($limit);

$query = $builder->getQuery();
$query->setHydrationMode($this->resultMode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,22 @@ public function getRepository()

/**
* Get shipping methods
*
* @param int $offset
* @param int $limit
* @param array $criteria
* @param array $orderBy
* @return array
*/
public function getList(array $criteria = [], array $orderBy = [])
public function getList($offset = 0, $limit = 25, array $criteria = [], array $orderBy = [])
{
$builder = $this->getRepository()->createQueryBuilder('shippingMethods');

// Create builder on requested filter and sort
$builder->addFilter($criteria)
->addOrderBy($orderBy);
->addOrderBy($orderBy)
->setFirstResult($offset)
->setMaxResults($limit);

$query = $builder->getQuery();
$query->setHydrationMode($this->resultMode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,22 @@ public function getRepository()

/**
* Get vat codes
*
* @param int $offset
* @param int $limit
* @param array $criteria
* @param array $orderBy
* @return array
*/
public function getList(array $criteria = [], array $orderBy = [])
public function getList($offset = 0, $limit = 25, array $criteria = [], array $orderBy = [])
{
$builder = $this->getRepository()->createQueryBuilder('vat');

// Create builder on requested filter and sort
$builder->addFilter($criteria)
->addOrderBy($orderBy);
->addOrderBy($orderBy)
->setFirstResult($offset)
->setMaxResults($limit);

$query = $builder->getQuery();
$query->setHydrationMode($this->resultMode);
Expand Down

0 comments on commit 8dacfa3

Please sign in to comment.