I am working on one Drupal 8.3 site. I created my own custom Authentication provider for REST API authorisation.
Following are the “authenticate” method sample code.
/** * {@inheritdoc} */ public function authenticate(Request $request) { try { $uid = 1;// passing 1 for testing. $accounts = $this->entityTypeManager->getStorage('user')->loadByProperties(array('uid' => $uid, 'status' => 1)); $account = reset($accounts); if ($account) { return $this->entityTypeManager->getStorage('user')->load($uid); } } return []; }
My doubt here is “$this->entityTypeManager->getStorage” is getting data from cache table. Or everytime it connect to db and generate response?
Sponsored by SupremePR