Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate DateOperatorType::TYPE_NULL and TYPE_NOT_NULL #6734

Merged
merged 1 commit into from
Jan 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions UPGRADE-3.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ UPGRADE 3.x
UPGRADE FROM 3.xx to 3.xx
=========================

### Deprecated `DateOperatorType::TYPE_NULL` and `DateOperatorType::TYPE_NOT_NULL`

We recommend using a specific filter for null values instead.

### Sonata\AdminBundle\Twig\Extension\SonataAdminExtension

- Deprecated `SonataAdminExtension::MOMENT_UNSUPPORTED_LOCALES` constant.
Expand Down
7 changes: 7 additions & 0 deletions src/Form/Type/Operator/DateOperatorType.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ final class DateOperatorType extends AbstractType
public const TYPE_EQUAL = 3;
public const TYPE_LESS_EQUAL = 4;
public const TYPE_LESS_THAN = 5;
/**
* @deprecated since sonata-project/admin-bundle 3.x, to be removed with 4.0
*/
public const TYPE_NULL = 6;
/**
* @deprecated since sonata-project/admin-bundle 3.x, to be removed with 4.0
*/
public const TYPE_NOT_NULL = 7;

/**
Expand All @@ -41,6 +47,7 @@ public function configureOptions(OptionsResolver $resolver)
'label_date_type_greater_than' => self::TYPE_GREATER_THAN,
'label_date_type_less_equal' => self::TYPE_LESS_EQUAL,
'label_date_type_less_than' => self::TYPE_LESS_THAN,
// NEXT_MAJOR: Remove the two following lines and remove all the translations.
'label_date_type_null' => self::TYPE_NULL,
'label_date_type_not_null' => self::TYPE_NOT_NULL,
],
Expand Down