GET an entry or entries by one of it's field values
Example:
/v1/section/someSectionHandle/uuid?value=719d72d7-4f0c-420b-993f-969af9ad34c1

@param string $sectionHandle
@param string $fieldHandle
@return JsonResponse
170399
public function getEntriesByFieldValue(string $sectionHandle, string $fieldHandle): JsonResponse
    {
        $request = $this->requestStack->getCurrentRequest();

        $optionsResponse = $this->preFlightOptions($request, self::ALLOWED_HTTP_METHODS);
        if ($optionsResponse) {
            return $optionsResponse;
        }

        $this->dispatcher->dispatch(
            ApiFetchEntries::NAME,
            new ApiFetchEntries($request, $sectionHandle)
        );

        if ($abort = $this->shouldAbort($request)) {
            return $abort;
        }

        // We may join and want to select something on what is in the joined table
        // Like this: accountHasRole:role&value=1,2,3
        $fieldHandles = explode(':', $fieldHandle);
        $fieldHandle = array_shift($fieldHandles);

        // You could have many results on a field value,
        // so add some control over the results with limit, offset and also sorting.
        $fieldValue = (string)$request->get('value');
        if (strpos($fieldValue, ',') !== false) {
            $fieldValue = explode(',', $fieldValue);
        }

        $offset = $request->get('offset', 0);
        $limit = $request->get('limit', 100);
        $orderBy = $request->get('orderBy', 'created');
        $sort = $request->get('sort', 'DESC');

        try {
            $section = $this->sectionManager->readByHandle(Handle::fromString($sectionHandle));

            try {
                $this->cache->start(
                    $section->getConfig()->getFullyQualifiedClassName(),
                    $this->getFields(),
                    self::CACHE_CONTEXT_GET_ENTRIES_BY_FIELD_VALUE,
                    $fieldHandle
                );
            } catch (\Psr\Cache\InvalidArgumentException $exception) {
                //
            }

            if ($this->cache->isHit()) {
                return new JsonResponse(
                    $this->cache->get(),
                    JsonResponse::HTTP_OK,
                    $this->getDefaultResponseHeaders($request)
                );
            }

            $readOptions = [
                ReadOptions::SECTION => $sectionHandle,
                ReadOptions::FIELD => [ $fieldHandle => $fieldValue ],
                ReadOptions::RELATE => $fieldHandles,
                ReadOptions::OFFSET => (int) $offset,
                ReadOptions::LIMIT => (int) $limit,
                ReadOptions::ORDER_BY => [ $orderBy => strtolower($sort) ],
                ReadOptions::FETCH_FIELDS => $request->get('fields', null)
            ];
            $entries = $this->readSection->read(ReadOptions::fromArray($readOptions));
            $responseData = [];
            foreach ($entries as $entry) {
                if ($entry instanceof CommonSectionInterface) {
                    $responseData[] = $this->serialize->toArray($request, $entry);
                } else {
                    $responseData[] = $entry;
                }
            }
            $jsonResponse = new JsonResponse(
                $responseData,
                JsonResponse::HTTP_OK,
                $this->getDefaultResponseHeaders($request)
            );
            $this->dispatcher->dispatch(
                ApiEntriesFetched::NAME,
                new ApiEntriesFetched(
                    $request,
                    $responseData,
                    $jsonResponse,
                    $entries
                )
            );

            if ($abort = $this->shouldAbort($request)) {
                return $abort;
            }

            $this->cache->set($responseData);

            return $jsonResponse;
        } catch (\Exception $exception) {
            return $this->errorResponse($request, $exception);
        }
    }
489354
public function getSection($section) {
		if (!isset($this->configValues[$section])) {
			return null;
		}
		return $this->configValues[$section];
	}
778258
private function getRelationshipsTo(
        string $fieldHandle,
        array $fieldInfo,
        string $sectionHandle,
        int $id = null
    ): ?array {

        if (!empty($fieldInfo[$fieldHandle]['to'])) {
            try {
                $sexyFieldInstructions = $this->getSexyFieldRelationshipInstructions($fieldInfo, $fieldHandle);

                // You can have a different name for elements through config
                $nameExpression = [];
                if (!empty($sexyFieldInstructions) &&
                    !empty($sexyFieldInstructions['name-expression'])
                ) {
                    $nameExpression = explode('|', $sexyFieldInstructions['name-expression']);
                }

                // Maybe you want to add some more fields to the relationship content
                $addFields = [];
                if (!empty($sexyFieldInstructions) &&
                    !empty($sexyFieldInstructions['add-fields'])
                ) {
                    $addFields = $sexyFieldInstructions['add-fields'];
                }

                $to = $this->readSection->read(
                    $this->getRelationshipReadOptions($fieldHandle, $fieldInfo, $sexyFieldInstructions)
                );
                $fieldInfo[$fieldHandle][$fieldInfo[$fieldHandle]['to']] = [];

                /** @var CommonSectionInterface $entry */
                foreach ($to as $entry) {

                    // Map the name-expression to override naming
                    $name = $entry->getDefault();

                    if ($nameExpression) {
                        $find = $entry;
                        foreach ($nameExpression as $method) {
                            if ($find) {
                                $find = $find->$method();
                            }
                        }
                        if ($find) {
                            $name = $find;
                        }
                    }

                    // Default relationship data
                    $data = [
                        'id' => $entry->getId(),
                        'slug' => (string) $entry->getSlug(),
                        'name' => $name,
                        'created' => $entry->getCreated(),
                        'updated' => $entry->getUpdated(),
                        'selected' => false
                    ];

                    // Add data if configured
                    foreach ($addFields as $field) {
                        $method = 'get' . ucfirst($field);
                        $data[$field] = (string) $entry->{$method}();
                    }

                    $fieldInfo[$fieldHandle][$fieldInfo[$fieldHandle]['to']][] = $data;
                }
            } catch (EntryNotFoundException $exception) {
                $fieldInfo[$fieldHandle][$fieldInfo[$fieldHandle]['to']]['error'] = $exception->getMessage();
            }

            if (!empty($id)) {
                $fieldInfo = $this->setSelectedRelationshipsTo(
                    $sectionHandle,
                    $fieldHandle,
                    $fieldInfo,
                    $id
                );
            }
        }

        return $fieldInfo;
    }
678341
public function calculateFieldInfo($currentValue, array $fieldData)
    {
        if (! $currentValue) {
            return $currentValue;
        }

        $lookup = $this->getLookup();

        if (isset($lookup[$currentValue])) {
            return $lookup[$currentValue];
        }

        return null;
    }
64670
public function deleteEntryBySlug(string $sectionHandle, string $slug): JsonResponse
    {
        $request = $this->requestStack->getCurrentRequest();

        $optionsResponse = $this->preFlightOptions($request, self::ALLOWED_HTTP_METHODS);
        if ($optionsResponse) {
            return $optionsResponse;
        }

        $this->dispatcher->dispatch(
            ApiDeleteEntry::NAME,
            new ApiDeleteEntry($request, $sectionHandle)
        );

        if ($abort = $this->shouldAbort($request)) {
            return $abort;
        }

        try {
            $entry = $this->readSection->read(ReadOptions::fromArray([
                ReadOptions::SECTION => $sectionHandle,
                ReadOptions::SLUG => $slug
            ]))->current();
            $success = $this->deleteSection->delete($entry);
            $responseData = ['success' => $success];
            $jsonResponse = new JsonResponse(
                $responseData,
                $success ? JsonResponse::HTTP_OK : JsonResponse::HTTP_NOT_FOUND,
                $this->getDefaultResponseHeaders($request)
            );
            $this->dispatcher->dispatch(
                ApiEntryDeleted::NAME,
                new ApiEntryDeleted($request, $responseData, $jsonResponse, $entry)
            );

            if ($abort = $this->shouldAbort($request)) {
                return $abort;
            }

            return $jsonResponse;
        } catch (\Exception $exception) {
            return $this->errorResponse($request, $exception);
        }
    }
321291
public function resolveField(FieldValue $fieldValue): FieldValue
    {
        /** @var string|null $guard */
        $guard = $this->directiveArgValue('guard');

        return $fieldValue->setResolver(
            function () use ($guard): ?Authenticatable {
                return $this
                    ->authFactory
                    ->guard($guard)
                    ->user();
            }
        );
    }
463552
public function onFieldDataLoad($currentValue, array $fieldData)
    {
        if (empty($currentValue)) {
            return null;
        }

        return new \MUtil_Date($currentValue, $this->getStorageFormat());
    }
1110978
private function &getHandle($url) {
      $http = curl_init();

      curl_setopt($http, CURLOPT_USERAGENT, Client::getUserAgent());
      curl_setopt($http, CURLOPT_RETURNTRANSFER, true);
      curl_setopt($http, CURLOPT_URL, $url);

      return $http;
    }
636423
public function getPackageVersions($packageHandle)
    {
        $this->start();
        try {
            $this->getUserControl()->checkRateLimit();
            $this->getUserControl()->checkGenericAccess(__FUNCTION__);
            $package = $this->app->make(PackageRepository::class)->findOneBy(['handle' => $packageHandle]);
            if ($package === null) {
                throw new UserMessageException(t('Unable to find the specified package'), Response::HTTP_NOT_FOUND);
            }
            $versions = [];
            foreach ($package->getSortedVersions(true, null) as $packageVersion) {
                $versions[] = $packageVersion->getVersion();
            }
            $result = $this->buildJsonResponse($versions);
        } catch (Exception $x) {
            $result = $this->buildErrorResponse($x);
        } catch (Throwable $x) {
            $result = $this->buildErrorResponse($x);
        }

        return $this->finish($result);
    }
1003018
protected function find(string $indexedFieldName, $fieldValue)
    {
        $fieldIndex = $this->getIndex($indexedFieldName);

        return isset($fieldIndex[$fieldValue]) ? $fieldIndex[$fieldValue] : null;
    }
1331272
private function _getProviderRecordByHandle($handle)
    {
        $providerRecord = Oauth_ProviderInfosRecord::model()->find(

            // conditions
            'class=:provider',

            // params
            array(
                ':provider' => $handle
            )
        );

        if($providerRecord)
        {
            return $providerRecord;
        }

        return null;
    }
1004775
private function setSelectedRelationshipsTo(
        string $sectionHandle,
        string $fieldHandle,
        array $fieldInfo,
        int $id
    ): array {
        /** @var CommonSectionInterface $editing */
        $editing = $this->readSection->read(
            ReadOptions::fromArray([
                ReadOptions::SECTION => $sectionHandle,
                ReadOptions::ID => (int)$id
            ])
        )->current();

        try {
            $method = $this->handleToPropertyName($fieldHandle, $editing::FIELDS);
            $relationshipsEntityMethod = 'get' . ucfirst($method);
            $related = $editing->{$relationshipsEntityMethod}();
            if (!is_null($related)) {
                $relatedIds = [];
                if (is_iterable($related)) {
                    /** @var CommonSectionInterface $relation */
                    foreach ($related as $relation) {
                        $relatedIds[] = $relation->getId();
                    }
                } else {
                    $relatedIds[] = $related->getId();
                }
                foreach ($fieldInfo[$fieldHandle][$fieldInfo[$fieldHandle]['to']] as &$relatable) {
                    if (!empty($relatable['id']) && in_array($relatable['id'], $relatedIds)) {
                        $relatable['selected'] = true;
                    }
                }
            }
        } catch (\Exception $exception) {
            // Empty because we can just return the fieldInfo the way it was if the above fails
        }

        return $fieldInfo;
    }
1090820
public static function getByHandle($fslTypeHandle)
    {
        $em = \ORM::entityManager();
        $type = $em->getRepository('\Concrete\Core\Entity\File\StorageLocation\Type\Type')->findOneBy(
            array('fslTypeHandle' => $fslTypeHandle,
         ));

        return $type;
    }
233916
public function getFieldCount($jsonResponse, $fieldName)
    {
        $arr = json_decode($jsonResponse)->{$fieldName};
        return count($arr, COUNT_RECURSIVE);
    }
1107930
public function getTokensByProvider($providerHandle)
    {
        $conditions = 'providerHandle=:providerHandle';
        $params = array(':providerHandle' => $providerHandle);
        $records = Oauth_TokenRecord::model()->findAll($conditions, $params);
        return Oauth_TokenModel::populateModels($records);
    }
181895
public function resolveField(FieldValue $fieldValue): FieldValue
    {
        return $fieldValue->setResolver(
            function ($root, array $args, GraphQLContext $context, ResolveInfo $resolveInfo): LengthAwarePaginator {
                /** @var int $first */
                /** @var int $page */
                [$first, $page] = PaginationUtils::extractArgs($args, $this->paginationType(), $this->paginateMaxCount());

                if ($this->directiveHasArgument('builder')) {
                    $query = call_user_func(
                        $this->getResolverFromArgument('builder'),
                        $root,
                        $args,
                        $context,
                        $resolveInfo
                    );
                } else {
                    /** @var \Illuminate\Database\Eloquent\Model $model */
                    $model = $this->getPaginatorModel();
                    $query = $model::query();
                }

                $query = $resolveInfo
                    ->builder
                    ->addScopes(
                        $this->directiveArgValue('scopes', [])
                    )
                    ->apply(
                        $query,
                        $args
                    );

                if ($query instanceof ScoutBuilder) {
                    return $query->paginate($first, 'page', $page);
                }

                return $query->paginate($first, ['*'], 'page', $page);
            }
        );
    }
318473
protected function processFieldsCollection($fieldCollection, $data, FormHandler $formHandler)
    {
        $fields = array();
        foreach ($fieldCollection as $field) {
            // Unnamed array fields
            if ($field['name'] === null) {
                if (!isset($i)) $i = 0;

                $field['name'] = $i;
                $field = $this->typeHandler->makeView($field, $data, $formHandler);
                $fields[] = $field;

                $i++;
            }
            // Named array fields
            else {
                $fieldName = $field['name'];
                $field = $this->typeHandler->makeView($field, $data, $formHandler);

                $field['has_error'] = false;
                if ($formHandler->fieldHasError($field['name'])) {
                    $field['has_error'] = true;
                }

                $fields[$fieldName] = $field;
            }
        }

        return $fields;
    }