this is error:
var//log/debug.log:[2019-12-10 10:59:36] main.CRITICAL: Report ID: webapi-5def7a98e911d; Message: Notice: Undefined index: entity_id in /Applications/MAMP/htdocs/Magento2_3/app/code/SimplifiedMagento/Custom2/Model/PositionRepository.php on line 46 {"exception":"[object] (Exception(code: 0): Report ID: webapi-5def7a98e911d; Message: Notice
This is my service method:
public function getDetails($email)
{
$emailId = $email;
$customer = $this->customerFactory->create();
$arr = $customer->getCollection()->addFieldToSelect(['entity_id'])->addFieldToFilter('email',$emailId)->getData();
$entityId = $arr['entity_id'];
//entity id is above
$customTable = $this->addDataFactory->create();
$array = $customTable->getCollection()->addFieldToSelect(['position'])->addFieldToFilter('customer_id',$entityId)->getData();
$position = $array['position'];
$obj = $this->positionInterfaceFactory->create()->setPosition($position);
return $obj;
}
}