@param CollectionFinderInterface $finder
@param string                    $fieldName

@return CollectionFinderInterface
972287
public function applyContainFilter(CollectionFinderInterface $finder, $fieldName)
    {
        $filterValue = $this->state->get("filter." . $fieldName, null);
        if (!empty($filterValue)) {
            $finder = $finder->with($fieldName, Operator::CONTAINS, $filterValue);
        }

        return $finder;
    }
183618
public function removeFinder(FormatFinder ...$finder) {
        foreach ($finder as $f) {
            if (false !== $offset = array_search($f, $this->finders, true)) {
                unset($this->finders[$offset]);
            }
        }
    }
645684
protected function doSelectCollection($name)
    {
        $mongoCollection = $this->mongoDB->selectCollection($name);

        return new Collection($this, $mongoCollection, $this->eventManager, $this->numRetries);
    }
1226717
public function getCollection(string $collectionName): Collection
    {
        $collectionFile = $this->getCollectionFilePath($collectionName);
        $storage = $this->factory->storage($collectionFile, $this->type);
        return $this->factory->collection($storage);
    }
804550
public function getSetter($fieldName)
    {
        if ($this->hasField($fieldName) === false) {
            return false;
        }

        return $this->mapping[$fieldName]['setter'];
    }
165272
public function addFinder(FormatFinder ...$finder) {
        foreach ($finder as $f) {
            if (false === array_search($f, $this->finders, true)) {
                $this->finders[] = $f;
            }
        }
    }
13179
private function arrayFinder(string $propertyName, $find, Closure $finderClosure)
    {
        return $this->filter(function ($data) use ($find, $propertyName, $finderClosure) {
            try {
                $attributeValue = $data->{$propertyName};
            } catch (\Exception $e) {
                $attributeValue = null;
            }

            return is_null($attributeValue)
                ? null
                : $finderClosure($find, $attributeValue, $data);
        });
    }
693225
public function findBySha1AndCollectionName($sha1Hash, $collectionName)
    {
        $query = $this->createQuery();
        $query->matching(
            $query->logicalAnd(
                $query->equals('sha1', $sha1Hash),
                $query->equals('collectionName', $collectionName)
            )
        );
        $resources = $query->execute()->toArray();
        foreach ($this->addedResources as $importedResource) {
            if ($importedResource->getSha1() === $sha1Hash && $importedResource->getCollectionName() === $collectionName) {
                $resources[] = $importedResource;
            }
        }

        return $resources;
    }
17753
public function find($finder, array $options = [])
    {
        /** @var \Cake\ORM\Table $table */
        $table = $this->getRepository();

        return $table->callFinder($finder, $this, $options);
    }
1316327
public function dropCollection($collectionName, array $options = [])
    {
        return $this->bridge->dropCollection($this->cName($collectionName), $options);
    }
799921
public function applyOrdering($finder, $fieldName = 'ordering')
    {
        $orderCol  = $this->state->get('list.ordering', $fieldName);
        $orderDirn = $this->state->get('list.direction', 'asc');

        if (!empty($orderCol)) {
            $finder = $finder->orderBy($orderCol, $orderDirn);
        }

        return $finder;
    }
762515
public function getCollector(): CollectorManager
    {
        if ($this->collector === null) {
            $this->collector = new CollectorManager($this);
        }

        return $this->collector;
    }
1282352
public function selectCollection($name) {

        if (!isset($this->collections[$name])) {

            if (!in_array($name, $this->getCollectionNames())) {
                $this->createCollection($name);
            }

            $this->collections[$name] = new Collection($name, $this);
        }

        return $this->collections[$name];
    }
505119
protected function loadCollector($name, array $params = null) {
		$locator = $this->getCollectorsLocator();
		
		try {
			return $locator->get(ucfirst($name), $params);
		} catch (Exception $exception) {
			$this->pushException($exception);
		}
	}
196908
public function findFieldInArray($fieldname) {
        foreach ($this->fields as $i => $field) {
            if ($fieldname == $field->getName()) {
                return $i;
            }
        }
        return null;
    }
1264552
public function findOne($collection, array $criteria, array $fields = [])
    {
        return $this->dbConnection->selectCollection($collection)->findOne($criteria, $fields);
    }
207290
private function loadSerializerClassMap(Finder $finder)
    {
        $classMap = [];
        foreach ($finder as $file) {
            $document = new \DOMDocument();
            $document->load($file);

            $xpath = new \DOMXPath($document);

            $classMap = array_reduce(
                iterator_to_array($xpath->query('//class')),
                function (array $classMap, \DOMElement $element) {
                    $classMap[$element->getAttribute('name')] = $element;
                    return $classMap;
                },
                $classMap
            );
        }

        return $classMap;
    }