Compare commits

..

No commits in common. "2de3139c802b64d16ccbce3d4f522673864c58e7" and "75231f32b3a38771faa7d07e16fd2a8d30eb388d" have entirely different histories.

33 changed files with 10 additions and 50 deletions

View File

@ -10,7 +10,6 @@ class Table implements AdapterAttributeInterface {
public ? string $schema = null, public ? string $schema = null,
public ? string $adapter = null, public ? string $adapter = null,
public ? string $engine = null, public ? string $engine = null,
public string $description = "",
) {} ) {}
public function adapter() : false|string public function adapter() : false|string

View File

@ -14,6 +14,5 @@ class Field {
public mixed $default = null, public mixed $default = null,
public bool $readonly = false, public bool $readonly = false,
public null|int $decimal = null, public null|int $decimal = null,
public string $description = "",
) {} ) {}
} }

View File

@ -14,6 +14,5 @@ class Bigint extends \Ulmus\Attribute\Property\Field
public bool $nullable = false, public bool $nullable = false,
public mixed $default = null, public mixed $default = null,
public bool $readonly = false, public bool $readonly = false,
public string $description = "",
) {} ) {}
} }

View File

@ -14,6 +14,5 @@ class Bit extends \Ulmus\Attribute\Property\Field
public bool $nullable = false, public bool $nullable = false,
public mixed $default = null, public mixed $default = null,
public bool $readonly = false, public bool $readonly = false,
public string $description = "",
) {} ) {}
} }

View File

@ -14,6 +14,5 @@ class Blob extends \Ulmus\Attribute\Property\Field
public bool $nullable = false, public bool $nullable = false,
public mixed $default = null, public mixed $default = null,
public bool $readonly = false, public bool $readonly = false,
public string $description = "",
) {} ) {}
} }

View File

@ -13,6 +13,5 @@ class CreatedAt extends \Ulmus\Attribute\Property\Field {
public bool $nullable = false, public bool $nullable = false,
public mixed $default = null, public mixed $default = null,
public bool $readonly = false, public bool $readonly = false,
public string $description = "",
) {} ) {}
} }

View File

@ -11,6 +11,5 @@ class Date extends \Ulmus\Attribute\Property\Field {
public bool $nullable = false, public bool $nullable = false,
public mixed $default = null, public mixed $default = null,
public bool $readonly = false, public bool $readonly = false,
public string $description = "",
) {} ) {}
} }

View File

@ -11,6 +11,5 @@ class Datetime extends \Ulmus\Attribute\Property\Field {
public bool $nullable = false, public bool $nullable = false,
public mixed $default = null, public mixed $default = null,
public bool $readonly = false, public bool $readonly = false,
public string $description = "",
) {} ) {}
} }

View File

@ -14,6 +14,5 @@ class Decimal extends \Ulmus\Attribute\Property\Field
public bool $nullable = false, public bool $nullable = false,
public mixed $default = null, public mixed $default = null,
public bool $readonly = false, public bool $readonly = false,
public string $description = "",
) {} ) {}
} }

View File

@ -14,6 +14,5 @@ class Float extends \Ulmus\Attribute\Property\Field
public bool $nullable = false, public bool $nullable = false,
public mixed $default = null, public mixed $default = null,
public bool $readonly = false, public bool $readonly = false,
public string $description = "",
) {} ) {}
} }

View File

@ -26,7 +26,6 @@ class ForeignKey extends PrimaryKey {
public null|string $relation = null, public null|string $relation = null,
public ConstrainActionEnum $onDelete = ConstrainActionEnum::NoAction, public ConstrainActionEnum $onDelete = ConstrainActionEnum::NoAction,
public ConstrainActionEnum $onUpdate = ConstrainActionEnum::NoAction, public ConstrainActionEnum $onUpdate = ConstrainActionEnum::NoAction,
public string $description = "",
) { ) {
#$this->references = Attribute::handleArrayField($this->references, false); #$this->references = Attribute::handleArrayField($this->references, false);
} }

View File

@ -17,6 +17,5 @@ class Id extends \Ulmus\Attribute\Property\Field {
public bool $nullable = false, public bool $nullable = false,
public mixed $default = null, public mixed $default = null,
public bool $readonly = false, public bool $readonly = false,
public string $description = "",
) {} ) {}
} }

View File

@ -14,6 +14,5 @@ class Longblob extends \Ulmus\Attribute\Property\Field
public bool $nullable = false, public bool $nullable = false,
public mixed $default = null, public mixed $default = null,
public bool $readonly = false, public bool $readonly = false,
public string $description = "",
) {} ) {}
} }

View File

@ -14,6 +14,5 @@ class Longtext extends \Ulmus\Attribute\Property\Field
public bool $nullable = false, public bool $nullable = false,
public mixed $default = null, public mixed $default = null,
public bool $readonly = false, public bool $readonly = false,
public string $description = "",
) {} ) {}
} }

View File

@ -14,6 +14,5 @@ class Mediumblob extends \Ulmus\Attribute\Property\Field
public bool $nullable = false, public bool $nullable = false,
public mixed $default = null, public mixed $default = null,
public bool $readonly = false, public bool $readonly = false,
public string $description = "",
) {} ) {}
} }

View File

@ -14,6 +14,5 @@ class Mediumint extends \Ulmus\Attribute\Property\Field
public bool $nullable = false, public bool $nullable = false,
public mixed $default = null, public mixed $default = null,
public bool $readonly = false, public bool $readonly = false,
public string $description = "",
) {} ) {}
} }

View File

@ -14,6 +14,5 @@ class Mediumtext extends \Ulmus\Attribute\Property\Field
public bool $nullable = false, public bool $nullable = false,
public mixed $default = null, public mixed $default = null,
public bool $readonly = false, public bool $readonly = false,
public string $description = "",
) {} ) {}
} }

View File

@ -14,6 +14,5 @@ class Numeric extends \Ulmus\Attribute\Property\Field
public bool $nullable = false, public bool $nullable = false,
public mixed $default = null, public mixed $default = null,
public bool $readonly = false, public bool $readonly = false,
public string $description = "",
) {} ) {}
} }

View File

@ -16,6 +16,5 @@ class PrimaryKey extends \Ulmus\Attribute\Property\Field
public bool $nullable = false, public bool $nullable = false,
public mixed $default = null, public mixed $default = null,
public bool $readonly = false, public bool $readonly = false,
public string $description = "",
) {} ) {}
} }

View File

@ -14,6 +14,5 @@ class Smallint extends \Ulmus\Attribute\Property\Field
public bool $nullable = false, public bool $nullable = false,
public mixed $default = null, public mixed $default = null,
public bool $readonly = false, public bool $readonly = false,
public string $description = "",
) {} ) {}
} }

View File

@ -14,6 +14,5 @@ class Text extends \Ulmus\Attribute\Property\Field
public bool $nullable = false, public bool $nullable = false,
public mixed $default = null, public mixed $default = null,
public bool $readonly = false, public bool $readonly = false,
public string $description = "",
) {} ) {}
} }

View File

@ -5,13 +5,8 @@ namespace Ulmus\Attribute\Property\Field;
#[\Attribute(\Attribute::TARGET_PROPERTY)] #[\Attribute(\Attribute::TARGET_PROPERTY)]
class Time extends \Ulmus\Attribute\Property\Field class Time extends \Ulmus\Attribute\Property\Field
{ {
public function __construct( public function __construct(? string $type = "time", ? int $length = null)
public ? string $name = null, {
public ? string $type = "time", parent::__construct($type, $length);
public array $attributes = [], }
public bool $nullable = false,
public mixed $default = null,
public bool $readonly = false,
public string $description = "",
) {}
} }

View File

@ -5,13 +5,8 @@ namespace Ulmus\Attribute\Property\Field;
#[\Attribute(\Attribute::TARGET_PROPERTY)] #[\Attribute(\Attribute::TARGET_PROPERTY)]
class Timestamp extends \Ulmus\Attribute\Property\Field class Timestamp extends \Ulmus\Attribute\Property\Field
{ {
public function __construct( public function __construct(? string $type = "timestamp", ? int $length = null)
public ? string $name = null, {
public ? string $type = "timestamp", parent::__construct($type, $length);
public array $attributes = [], }
public bool $nullable = false,
public mixed $default = null,
public bool $readonly = false,
public string $description = "",
) {}
} }

View File

@ -14,6 +14,5 @@ class Blob extends \Ulmus\Attribute\Property\Field
public bool $nullable = false, public bool $nullable = false,
public mixed $default = null, public mixed $default = null,
public bool $readonly = false, public bool $readonly = false,
public string $description = "",
) {} ) {}
} }

View File

@ -14,6 +14,5 @@ class Tinyint extends \Ulmus\Attribute\Property\Field
public bool $nullable = false, public bool $nullable = false,
public mixed $default = null, public mixed $default = null,
public bool $readonly = false, public bool $readonly = false,
public string $description = "",
) {} ) {}
} }

View File

@ -14,6 +14,5 @@ class Tinytext extends \Ulmus\Attribute\Property\Field
public bool $nullable = false, public bool $nullable = false,
public mixed $default = null, public mixed $default = null,
public bool $readonly = false, public bool $readonly = false,
public string $description = "",
) {} ) {}
} }

View File

@ -15,6 +15,5 @@ class UpdatedAt extends \Ulmus\Attribute\Property\Field
public bool $nullable = true, public bool $nullable = true,
public mixed $default = null, public mixed $default = null,
public bool $readonly = false, public bool $readonly = false,
public string $description = "",
) {} ) {}
} }

View File

@ -9,6 +9,5 @@ class SearchGroupBy extends SearchParameter
{ {
public function __construct( public function __construct(
public null|string|\Stringable|array $field = null, public null|string|\Stringable|array $field = null,
public string $description = "",
) {} ) {}
} }

View File

@ -12,6 +12,5 @@ class SearchLike extends SearchParameter
public null|string|\Stringable|array $field = null, public null|string|\Stringable|array $field = null,
public bool $toggle = false, public bool $toggle = false,
public SearchMethodEnum $method = SearchMethodEnum::Like, public SearchMethodEnum $method = SearchMethodEnum::Like,
public string $description = "",
) {} ) {}
} }

View File

@ -15,6 +15,5 @@ class SearchOrderBy extends SearchParameter
public ? string $parameter = null, public ? string $parameter = null,
public null|string|\Stringable|array $field = null, public null|string|\Stringable|array $field = null,
public null|SearchMethodEnum $order = null, public null|SearchMethodEnum $order = null,
public string $description = "",
) {} ) {}
} }

View File

@ -10,6 +10,5 @@ class SearchRequestParameter
public function __construct( public function __construct(
public string $class, public string $class,
public ? string $alias = null, public ? string $alias = null,
public string $description = "",
) {} ) {}
} }

View File

@ -12,6 +12,5 @@ class SearchWhere extends SearchParameter
public null|string|\Stringable|array $field = null, public null|string|\Stringable|array $field = null,
public bool $toggle = false, public bool $toggle = false,
public SearchMethodEnum $method = SearchMethodEnum::Where, public SearchMethodEnum $method = SearchMethodEnum::Where,
public string $description = "",
) {} ) {}
} }

View File

@ -4,7 +4,7 @@ namespace Ulmus\SearchRequest;
use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\ServerRequestInterface;
use Ulmus\SearchRequest\Attribute\{ SearchParameter, SearchWhere, SearchLike, SearchOrderBy, SearchGroupBy, SearchRequestParameter, }; use Ulmus\SearchRequest\Attribute\{ SearchParameter, SearchWhere, SearchOrderBy, SearchGroupBy, SearchRequestParameter, };
trait SearchRequestFromRequestTrait trait SearchRequestFromRequestTrait
{ {
@ -53,7 +53,7 @@ trait SearchRequestFromRequestTrait
$value = $queryParams->offsetExists($queryParamName) ? $this->transformValue($attributeList, $queryParams[$queryParamName]) : null; $value = $queryParams->offsetExists($queryParamName) ? $this->transformValue($attributeList, $queryParams[$queryParamName]) : null;
if ($attribute instanceof SearchWhere || $attribute instanceof SearchLike) { if ($attribute instanceof SearchWhere) {
if ($attribute->toggle) { if ($attribute->toggle) {
$this->$propertyName = $queryParams->offsetExists($queryParamName); $this->$propertyName = $queryParams->offsetExists($queryParamName);
} }