Skip to content

Commit

Permalink
Move the Operator constants into a separate interface
Browse files Browse the repository at this point in the history
  • Loading branch information
cundd committed Feb 14, 2019
1 parent c0dba51 commit a947b2c
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 82 deletions.
84 changes: 84 additions & 0 deletions Classes/VirtualObject/Persistence/OperatorInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?php
declare(strict_types=1);

namespace Cundd\Rest\VirtualObject\Persistence;

interface OperatorInterface
{
/**
* The '=' comparison operator.
*
* @api
*/
public const OPERATOR_EQUAL_TO = 1;

/**
* The '!=' comparison operator.
*
* @api
*/
public const OPERATOR_NOT_EQUAL_TO = 2;

/**
* The '<' comparison operator.
*
* @api
*/
public const OPERATOR_LESS_THAN = 3;

/**
* The '<=' comparison operator.
*
* @api
*/
public const OPERATOR_LESS_THAN_OR_EQUAL_TO = 4;

/**
* The '>' comparison operator.
*
* @api
*/
public const OPERATOR_GREATER_THAN = 5;

/**
* The '>=' comparison operator.
*
* @api
*/
public const OPERATOR_GREATER_THAN_OR_EQUAL_TO = 6;

/**
* The 'like' comparison operator.
*
* @api
*/
public const OPERATOR_LIKE = 7;

/**
* The 'contains' comparison operator for collections.
*
* @api
*/
public const OPERATOR_CONTAINS = 8;

/**
* The 'in' comparison operator.
*
* @api
*/
public const OPERATOR_IN = 9;

/**
* The 'is NULL' comparison operator.
*
* @api
*/
public const OPERATOR_IS_NULL = 10;

/**
* The 'is empty' comparison operator for collections.
*
* @api
*/
public const OPERATOR_IS_EMPTY = 11;
}
87 changes: 5 additions & 82 deletions Classes/VirtualObject/Persistence/QueryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,104 +8,27 @@
/**
* A persistence query interface
*/
interface QueryInterface
interface QueryInterface extends OperatorInterface
{
/**
* The '=' comparison operator.
*
* @api
*/
const OPERATOR_EQUAL_TO = 1;

/**
* The '!=' comparison operator.
*
* @api
*/
const OPERATOR_NOT_EQUAL_TO = 2;

/**
* The '<' comparison operator.
*
* @api
*/
const OPERATOR_LESS_THAN = 3;

/**
* The '<=' comparison operator.
*
* @api
*/
const OPERATOR_LESS_THAN_OR_EQUAL_TO = 4;

/**
* The '>' comparison operator.
*
* @api
*/
const OPERATOR_GREATER_THAN = 5;

/**
* The '>=' comparison operator.
*
* @api
*/
const OPERATOR_GREATER_THAN_OR_EQUAL_TO = 6;

/**
* The 'like' comparison operator.
*
* @api
*/
const OPERATOR_LIKE = 7;

/**
* The 'contains' comparison operator for collections.
*
* @api
*/
const OPERATOR_CONTAINS = 8;

/**
* The 'in' comparison operator.
*
* @api
*/
const OPERATOR_IN = 9;

/**
* The 'is NULL' comparison operator.
*
* @api
*/
const OPERATOR_IS_NULL = 10;

/**
* The 'is empty' comparison operator for collections.
*
* @api
*/
const OPERATOR_IS_EMPTY = 11;

/**
* Logical AND
*/
const COMBINATOR_AND = 'AND';
public const COMBINATOR_AND = 'AND';

/**
* Logical OR
*/
const COMBINATOR_OR = 'OR';
public const COMBINATOR_OR = 'OR';

/**
* Ascending ordering of results
*/
const ORDER_ASCENDING = 'ASC';
public const ORDER_ASCENDING = 'ASC';

/**
* Descending ordering of results
*/
const ORDER_DESCENDING = 'DESC';
public const ORDER_DESCENDING = 'DESC';

/**
* Executes the query and returns the result
Expand Down

0 comments on commit a947b2c

Please sign in to comment.