Skip to content

Commit

Permalink
Move isFieldEmpty() to ElementInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Jul 11, 2020
1 parent 9bc5de4 commit e7c9431
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-v3.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
- Added `craft\base\ElementInterface::getTitleTranslationDescription()`.
- Added `craft\base\ElementInterface::getTitleTranslationKey()`.
- Added `craft\base\ElementInterface::gqlMutationNameByContext()`.
- Added `craft\base\ElementInterface::isFieldEmpty()`.
- Added `craft\base\ElementTrait::$elementSiteId`.
- Added `craft\base\Field::EVENT_DEFINE_INPUT_HTML`. ([#5867](https://github.com/craftcms/cms/issues/5867))
- Added `craft\base\Field::EVENT_DEFINE_KEYWORDS`. ([#6028](https://github.com/craftcms/cms/issues/6028))
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- Added `craft\base\ElementInterface::getIsTitleTranslatable()`.
- Added `craft\base\ElementInterface::getTitleTranslationDescription()`.
- Added `craft\base\ElementInterface::getTitleTranslationKey()`.
- Added `craft\base\ElementInterface::isFieldEmpty()`.
- Added `craft\base\Model::EVENT_DEFINE_EXTRA_FIELDS`.
- Added `craft\base\Model::EVENT_DEFINE_FIELDS`.
- Added `craft\controllers\UtilitiesController::actionProjectConfigPerformAction()`.
Expand Down
5 changes: 1 addition & 4 deletions src/base/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -1710,10 +1710,7 @@ public function validateCustomFieldAttribute(string $attribute, array $params =
}

/**
* Returns whether a field is empty.
*
* @param string $handle
* @return bool
* @inheritdoc
*/
public function isFieldEmpty(string $handle): bool
{
Expand Down
8 changes: 8 additions & 0 deletions src/base/ElementInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,14 @@ public function getTitleTranslationDescription();
*/
public function getTitleTranslationKey(): string;

/**
* Returns whether a field is empty.
*
* @param string $handle
* @return bool
*/
public function isFieldEmpty(string $handle): bool;

/**
* Returns the element’s normalized custom field values, indexed by their handles.
*
Expand Down

0 comments on commit e7c9431

Please sign in to comment.