- Added some SearchRequest attributes ; now it's even simpler to add searchable fields
- Began decoupling of QueryBuilder from native MySQL method ; some works needs to be done on for the Repository object splitting also.
This commit is contained in:
1 parent
15be1597b8
commit
4571517dc8
30 files changed
+1007
-615
No files matched your search
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Ulmus\SearchRequest\Attribute;
|
||||
|
||||
#[\Attribute(\Attribute::TARGET_PROPERTY)]
|
||||
class SearchEqual extends SearchWhere {}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Ulmus\SearchRequest\Attribute;
|
||||
|
||||
use Ulmus\SearchRequest\SearchMethodEnum;
|
||||
|
||||
#[\Attribute(\Attribute::TARGET_PROPERTY)]
|
||||
class SearchGroupBy extends SearchParameter
|
||||
{
|
||||
public function __construct(
|
||||
public ? string $parameter = null,
|
||||
public ? string $field = null,
|
||||
public bool $toggle = false,
|
||||
public SearchMethodEnum $method = SearchMethodEnum::GroupBy,
|
||||
) {}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Ulmus\SearchRequest\Attribute;
|
||||
|
||||
use Ulmus\SearchRequest\SearchMethodEnum;
|
||||
|
||||
#[\Attribute(\Attribute::TARGET_PROPERTY)]
|
||||
class SearchLike extends SearchParameter
|
||||
{
|
||||
public function __construct(
|
||||
public ? string $parameter = null,
|
||||
public ? string $field = null,
|
||||
public bool $toggle = false,
|
||||
public SearchMethodEnum $method = SearchMethodEnum::Like,
|
||||
) {}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Ulmus\SearchRequest\Attribute;
|
||||
|
||||
use Ulmus\SearchRequest\SearchMethodEnum;
|
||||
|
||||
#[\Attribute(\Attribute::TARGET_PROPERTY)]
|
||||
class SearchOrderBy extends SearchParameter
|
||||
{
|
||||
public function __construct(
|
||||
public ? string $parameter = null,
|
||||
public ? string $field = null,
|
||||
public bool $toggle = false,
|
||||
public SearchMethodEnum $method = SearchMethodEnum::OrderByAsc,
|
||||
) {}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Ulmus\SearchRequest\Attribute;
|
||||
|
||||
use Ulmus\SearchRequest\SearchMethodEnum;
|
||||
|
||||
#[\Attribute(\Attribute::TARGET_PROPERTY)]
|
||||
class SearchParameter
|
||||
{
|
||||
public function __construct(
|
||||
public ? string $parameter = null,
|
||||
public ? string $field = null,
|
||||
public bool $toggle = false,
|
||||
public SearchMethodEnum $method = SearchMethodEnum::Manual,
|
||||
) {}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Ulmus\SearchRequest\Attribute;
|
||||
|
||||
use Ulmus\SearchRequest\SearchMethodEnum;
|
||||
|
||||
#[\Attribute(\Attribute::TARGET_CLASS)]
|
||||
class SearchRequestParameter
|
||||
{
|
||||
public function __construct(
|
||||
public string $class,
|
||||
) {}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Ulmus\SearchRequest\Attribute;
|
||||
|
||||
use Ulmus\SearchRequest\SearchMethodEnum;
|
||||
|
||||
#[\Attribute(\Attribute::TARGET_PROPERTY)]
|
||||
class SearchWhere extends SearchParameter
|
||||
{
|
||||
public function __construct(
|
||||
public ? string $parameter = null,
|
||||
public ? string $field = null,
|
||||
public bool $toggle = false,
|
||||
public SearchMethodEnum $method = SearchMethodEnum::Where,
|
||||
) {}
|
||||
}
|
||||
Reference in new issue
Block a user