/** * @param mixed $record_id * @return \record_adapter|null */ public function find($record_id) { $record = new \record_adapter($this->app, $this->databox->get_sbas_id(), $record_id, null, false); try { $data = $record->get_data_from_cache(); } catch (Exception $exception) { $data = false; } if (false === $data) { static $sql; if (!$sql) { $sql = $this->createSelectBuilder()->where('record_id = :record_id')->getSQL(); } $data = $this->databox->get_connection()->fetchAssoc($sql, ['record_id' => $record_id]); } if (false === $data) { return null; } return $this->mapRecordFromResultRow($data, $record); }