I have a entity ID and want to get the Entity object via repository, currently we do
$criteria = new Criteria();
$criteria->addFilter(new EqualsFilter('id', $propertyId));
$property = $this->propertyGroupOptionRepository->search(
$criteria,
$this->context
)->first();
if($property) {
return $property->get('groupId');
}
Is there a nicer way, like Laravel's find method?