Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
* @return \Drupal\Core\Entity\EntityInterface
* Returns the entity matching the values.
*/
public function getEntity(ResultRow $values);
Looking at the code for the implementation, this can also return NULL.
Comment | File | Size | Author |
---|---|---|---|
#7 | D8-getEntity-return-NULL-2657826-7.patch | 815 bytes | er.pushpinderrana |
#5 | D8-getEntity-return-NULL-2657826-5.patch | 784 bytes | er.pushpinderrana |
Comments
Comment #2
jhodgdonAdding related issue
Comment #4
vinod_kc CreditAttribution: vinod_kc at Zyxware Technologies commentedComment #5
er.pushpinderrana CreditAttribution: er.pushpinderrana as a volunteer and at Publicis Sapient for Publicis Sapient commentedPlease review.
Comment #6
jhodgdonThanks for the patch!
This wording seems a bit odd to me. Maybe at the end something like:
or NULL if there is no matching entity.
would be clearer?
Comment #7
er.pushpinderrana CreditAttribution: er.pushpinderrana as a volunteer and at Publicis Sapient for Publicis Sapient commentedThank you! Updated your suggestion in this patch.
Comment #8
jhodgdonThat looks better to me. Thanks!
Comment #9
alexpottI think the null typehint should be at the end - it is the less common case.
Committed a9d0778 and pushed to 8.1.x and 8.2.x. Thanks!
Comment #13
cilefen CreditAttribution: cilefen commented