mirror of
https://github.com/flextype/flextype.git
synced 2025-08-13 08:34:19 +02:00
Flextype Core: Entries API cleanup and refactoring
This commit is contained in:
@@ -38,6 +38,39 @@ class Entries
|
||||
*/
|
||||
public $entries = [];
|
||||
|
||||
/**
|
||||
* Set Expression
|
||||
*
|
||||
* @var array
|
||||
* @access public
|
||||
*/
|
||||
public $expression = [
|
||||
'=' => Comparison::EQ,
|
||||
'<>' => Comparison::NEQ,
|
||||
'<' => Comparison::LT,
|
||||
'<=' => Comparison::LTE,
|
||||
'>' => Comparison::GT,
|
||||
'>=' => Comparison::GTE,
|
||||
'is' => Comparison::IS,
|
||||
'in' => Comparison::IN,
|
||||
'nin' => Comparison::NIN,
|
||||
'contains' => Comparison::CONTAINS,
|
||||
'member_of' => Comparison::MEMBER_OF,
|
||||
'start_with' => Comparison::STARTS_WITH,
|
||||
'ends_with' => Comparison::ENDS_WITH,
|
||||
];
|
||||
|
||||
/**
|
||||
* Set Order Direction
|
||||
*
|
||||
* @var array
|
||||
* @access public
|
||||
*/
|
||||
public $direction = [
|
||||
'asc' => Criteria::ASC,
|
||||
'desc' => Criteria::DESC,
|
||||
];
|
||||
|
||||
/**
|
||||
* Flextype Dependency Container
|
||||
*
|
||||
@@ -137,7 +170,7 @@ class Entries
|
||||
*
|
||||
* @param array $args Query arguments
|
||||
*
|
||||
* @return array The entries
|
||||
* @return array The entries array data
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
@@ -147,27 +180,10 @@ class Entries
|
||||
$entries = [];
|
||||
|
||||
// Set Expression
|
||||
$expression = [
|
||||
'=' => Comparison::EQ,
|
||||
'<>' => Comparison::NEQ,
|
||||
'<' => Comparison::LT,
|
||||
'<=' => Comparison::LTE,
|
||||
'>' => Comparison::GT,
|
||||
'>=' => Comparison::GTE,
|
||||
'is' => Comparison::IS,
|
||||
'in' => Comparison::IN,
|
||||
'nin' => Comparison::NIN,
|
||||
'contains' => Comparison::CONTAINS,
|
||||
'member_of' => Comparison::MEMBER_OF,
|
||||
'start_with' => Comparison::STARTS_WITH,
|
||||
'ends_with' => Comparison::ENDS_WITH,
|
||||
];
|
||||
$expression = $this->expression;
|
||||
|
||||
// Set Direction
|
||||
$direction = [
|
||||
'asc' => Criteria::ASC,
|
||||
'desc' => Criteria::DESC,
|
||||
];
|
||||
$direction = $this->direction;
|
||||
|
||||
// Bind: entry id
|
||||
$bind_id = $id;
|
||||
|
Reference in New Issue
Block a user