Return a single record/entity specified by an $id

TODO Handle export within export() method

@param string $id
@return array
488874
public function find($id)
    {
        $result = $this->model->findOrFail($id)->toArray();

        return $this->export($result);
    }
1219724
public function findOrFail(int $id)
    {
        $response = $this->model->with($this->with)->findOrFail($id);
        $this->with = [];
        return $response;
    }
28913
public function getOriginalEntityState($id)
    {
        if (isset($this->entityStateReferences[$id])) {
            return $this->entityStateReferences[$id];
        }

        return null;
    }
1192333
public function getByID($id)
    {
        $pkey = $this->getPrimaryKey();
        if ($pkey === null)
            throw new DAOException("A primary key is required to select a record by ID");

        // If there's a unary primary key, the value can be specified as a
        // single scalar, rather than an array
        if (count($pkey) === 1 && is_scalar($id))
            foreach ($pkey as $colname => $def)
                $id = [$colname => $id];


        $condition = $this->getSelector($pkey, $id);
        $rec = $this->fetchSingle(QB::where($condition));
        if (empty($rec))
            throw new DAOEXception("Object not found with " . WF::str($id));

        $model = new $this->model_class;
        $model->assignRecord($rec, $this->db);
        return $model;
    }
1302400
public function read($id)
    {
        $class = $this->getEntityClassFromType($this->apiRecordType);
        $entity = $this->getEntityManager()->find($class, $id);

        if (!$entity) {
            return new Response('', Response::HTTP_NOT_FOUND);
        }

        return new JsonResponse($this->getApiWriter()->writeObject($entity), Response::HTTP_CREATED);
    }
800301
public function findById(int $id)
    {
        $entity = null;

        for ($i = 0; $i < count($this->registries); $i++) {
            /** @var RegistryInterface $registry */
            $registry = $this->registries[ $i ];
            $entity = $registry->findByKey($id);

            if ($entity instanceof AbstractEntity) {
                $this->updateRegistries([$entity], $i - 1);
                break;
            }
        }

        return $entity;
    }
53376
protected function getData($id)
    {
        $data = (new Query())->select(['data'])
                ->from($this->tableName)
                ->where(['id' => $id])->scalar();
        if ($data !== false) {
            return empty($data) ? [] : unserialize($data);
        }
        return false;
    }
685349
public function findById($id)
    {
        $post = get_post($id);
        if (!is_null($post)) {
            return self::getEntity($post);
        }
    }
1124850
public function getById($id)
    {
        $list = $this->getByCriteria($id, $this->getUniqueId());
        return reset($list);
    }
553790
public function get($id) {
		$e = $this->getEntity();
		
		if (! $e)
			return $this->createResponse($this->getNameManager()->getTableNames(), 401, "Tables");
		
		if (! $e->get($id))
			return $this->createResponse($id, 401, "{$this->getNameManager()->entityName} not found");
		
		return $this->createResponse($e->getArrayCopy(), 0, $this->getNameManager()->entityName);
	}
59526
public function getActions($id)
    {
        $actions = $this->adapter->get(sprintf('%s/volumes/%s/actions?per_page=%d', $this->endpoint, $id, 200));

        $actions = json_decode($actions);

        $this->meta = $this->extractMeta($actions);

        return array_map(function ($action) {
            return new ActionEntity($action);
        }, $actions->actions);
    }
401521
public function getDataById($id)
    {
        $id = (int)$id;
        return array_key_exists($id, $this->_data) ? $this->_data[$id] : null;
    }
1253763
public function getById($id)
    {
        $volume = $this->adapter->get(sprintf('%s/volumes/%s?per_page=%d', $this->endpoint, $id, 200));

        $volume = json_decode($volume);

        return new VolumeEntity($volume->volume);
    }
1213219
public function getAction($id)
    {
        $view = $this->responseGetById(
            $id,
            function($id) {
                return $this->getDoctrine()
                    ->getRepository(self::$entityName)
                    ->find($id);
            }
        );

        return $this->handleView($view);
    }
507030
public function getById($id)
    {
        $database = DatabaseLayer::getInstance();
        $select = $database->select($this->getTableName(), $this->getTableAlias());
        $select->fields($this->getTableAlias());
        $select->condition($this->getIDField(), $id);
        $results = $select->execute(get_called_class());
        $result = end($results);
        return $result;
    }
812442
protected function findOrFail($id)
    {
        $model = $this->model;
        if ($this->withTrashed()) {
            return $model::withTrashed()->findOrFail($id);
        } else {
            return $model::findOrFail($id);
        }
    }
900827
public function get(string $id): ?array
  {
    $mask = $this->db->rselect('bbn_notes_masks', [], ['id_note' => $id]);
    if ( $data = $this->notes->get($mask['id_note']) ){
      $data['default'] = $mask['def'];
      $data['id_type'] = $mask['id_type'];
      $data['type'] = $this->o->text($mask['id_type']);
      $data['name'] = $mask['name'];
      return $data;
    }
    return null;
  }