Skip to content

Commit

Permalink
Remove deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
cundd committed Dec 18, 2018
1 parent 94bb56c commit cc0e58a
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 58 deletions.
84 changes: 53 additions & 31 deletions Classes/VirtualObject/Persistence/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@
*/
class Query implements QueryInterface
{
/**
* @var \Cundd\Rest\VirtualObject\Persistence\BackendInterface
* @inject
*/
protected $backend;

/**
* @var \Cundd\Rest\VirtualObject\Persistence\PersistenceManager
* @inject
Expand Down Expand Up @@ -63,57 +57,85 @@ public function count()
return $this->persistenceManager->getObjectCountByQuery($this);
}

public function setOrderings(array $orderings)
public function getOrderings()
{
$this->orderings = $orderings;

return $this;
return $this->orderings;
}

public function setLimit($limit)
public function getLimit()
{
$this->limit = $limit;

return $this;
return $this->limit;
}

public function setOffset($offset)
public function getOffset()
{
$this->offset = $offset;

return $this;
return $this->offset;
}

public function getOrderings()
public function getConstraint()
{
return $this->orderings;
return $this->constraint;
}

public function getLimit()
public function getSourceIdentifier()
{
return $this->limit;
return $this->sourceIdentifier;
}

public function getOffset()
/**
* Return a copy of the Query with the given constraints
*
* @param array $constraint
* @return QueryInterface
*/
public function withConstraints(array $constraint): QueryInterface
{
return $this->offset;
$clone = clone $this;
$clone->constraint = $constraint;

return $clone;
}

public function getConstraint()
/**
* Return a copy of the Query with the given orderings
*
* @param array $orderings
* @return QueryInterface
*/
public function withOrderings(array $orderings): QueryInterface
{
return $this->constraint;
$clone = clone $this;
$clone->orderings = $orderings;

return $clone;
}

public function setConstraint($constraint)
/**
* Return a copy of the Query with the given limit
*
* @param int $limit
* @return QueryInterface
*/
public function withLimit(int $limit): QueryInterface
{
$this->constraint = $constraint;
$clone = clone $this;
$clone->limit = $limit;

return $this;
return $clone;
}

public function getSourceIdentifier()
/**
* Return a copy of the Query with the given offset
*
* @param int $offset
* @return QueryInterface
*/
public function withOffset(int $offset): QueryInterface
{
return $this->sourceIdentifier;
$clone = clone $this;
$clone->offset = $offset;

return $clone;
}

public function setConfiguration($configuration)
Expand Down
48 changes: 21 additions & 27 deletions Classes/VirtualObject/Persistence/QueryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,48 +113,42 @@ interface QueryInterface
public function execute();

/**
* Sets the property names to order the result by. Expected like this:
* array(
* 'foo' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING,
* 'bar' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING
* )
* Return a copy of the Query with the given constraints
*
* @param array $orderings The property names to order by
* @return QueryInterface
* @api
* @param array $constraint
* @return Query
*/
public function setOrderings(array $orderings);
public function withConstraints(array $constraint): self;

/**
* Sets the maximum size of the result set to limit
* Return a copy of the Query with the given property names to order the result by
*
* Returns $this to allow for chaining (fluid interface)
* @example
* [
* 'foo' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING,
* 'bar' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING
* ]
*
* @param integer $limit
* @return QueryInterface
* @api
* @param array $orderings
* @return Query
*/
public function setLimit($limit);
public function withOrderings(array $orderings): self;

/**
* Sets the start offset of the result set to offset
*
* Returns $this to allow for chaining (fluid interface).
* Return a copy of the Query with the given limit
*
* @param integer $offset
* @return QueryInterface
* @api
* @param int $limit
* @return Query
*/
public function setOffset($offset);
public function withLimit(int $limit): self;

/**
* Gets the constraint for this query
* Return a copy of the Query with the given offset
*
* @param array $constraint
* @return QueryInterface
* @api
* @param int $offset
* @return Query
*/
public function setConstraint($constraint);
public function withOffset(int $offset): self;

/**
* Returns the query result count
Expand Down

0 comments on commit cc0e58a

Please sign in to comment.