Is there a way to use EntityStorageBase::loadByProperties()
to specify that a field is either empty or not empty? I just want to check whether or not a field_date_completed
has a value set one it.
Looking to do something like $this->myEntityStorage->loadByProperties(['field_date_completed'=> notEmpty])
or $this->myEntityStorage->loadByProperties(['field_date_completed'=> isEmpty])
EDIT: Sorted out a solution using the accepted answer. Per How get empty record on date field with entityQuery?, we can do something like
$query = $this->myEntityStorage
->getQuery()
->notExists('field_data_completed');
$entity_ids = $query->execute();