Get customised data if we have a customiser set

@param TaskLogCollection $collection
@return array
6514
private function getCustomisedData(TaskLogCollection $collection)
    {
        $data = [];

        if (!is_null($this->rowCustomiser)) {
            foreach ($collection as $taskLogEntity) {
                $newCustomiser = $this->rowCustomiser->bindTo($taskLogEntity, $taskLogEntity);

                $data[] = array_merge($taskLogEntity->toArray(), (array) $newCustomiser());
            }
        }

        return $data;
    }
283386
public static function get_metadata(collection $collection) : collection {
        $completedfields = [
            'userid' => 'privacy:metadata:completed:userid',
            'timemodified' => 'privacy:metadata:completed:timemodified',
            'anonymous_response' => 'privacy:metadata:completed:anonymousresponse',
        ];

        $collection->add_database_table('feedback_completed', $completedfields, 'privacy:metadata:completed');
        $collection->add_database_table('feedback_completedtmp', $completedfields, 'privacy:metadata:completedtmp');

        $valuefields = [
            'value' => 'privacy:metadata:value:value'
        ];

        $collection->add_database_table('feedback_value', $valuefields, 'privacy:metadata:value');
        $collection->add_database_table('feedback_valuetmp', $valuefields, 'privacy:metadata:valuetmp');

        return $collection;
    }
565590
public function get($collection)
    {
        $collection = $this->makeCollection($collection);

        $url      = UrlHelper::buildUrl(Urls::URL_COLLECTION, [$collection]);
        $response = $this->getConnection()->get($url);

        $data = $response->getJson();

        return Collection::createFromArray($data);
    }
304252
public function queueCollection(CollectionAbstract $collection)
    {
        $log = $this->getLogger();
        $context = array('collection' => $collection->getId());
        $log->info('Begin fetching items that are scheduled for indexing', $context);

        $event = new CollectionEvent($this, $collection);
        $this->dispatchEvent(SearchEvents::COLLECTION_PRE_QUEUE, $event, $context);

        // The producer fetches the items scheduled for indexing from the
        // collection and publishes them to the indexing queue.
        $producer = new QueueProducer($this, $collection);
        foreach ($producer as $message) {
            // @todo Have this return a boolean suceess flag and modify the log
            // message accordingly?
            $message->publish();

            $context['item'] = $message->getBody();
            $log->debug('Published item scheduled for indexing to queue', $context);
        }

        unset($context['item']); // The item is no longer in context.
        $this->dispatchEvent(SearchEvents::COLLECTION_POST_QUEUE, $event, $context);

        // Get and log the number of items queued for this collection.
        $num_queued = count($producer);
        $context['queued'] = $num_queued;
        $log->info('Finished fetching and queueing items that are scheduled for indexing', $context);

        return $num_queued;
    }
1361547
public function bulkSave($collection = [])
    {
        $params = [];

        $defaultIndex = $this->connection->getDefaultIndex();

        foreach ($collection as $item) {
            $modelIndex = $item->getDocumentIndex();

            $params['body'][] = [
                'index' => [
                    '_id'    => $item->getKey(),
                    '_type'  => $item->getDocumentType(),
                    '_index' => $modelIndex ? $modelIndex : $defaultIndex,
                ],
            ];
            $params['body'][] = $item->getDocumentData();
        }

        return $this->connection->bulkStatement($params);
    }
682794
public function getCollectionData($collection, $criteria = null)
    {
        if (is_null($this->dbPath)) {
            $this->prepareDatabaseEcosystem();
        }

        if (! is_dir($this->dbPath.'/'.$collection)) {
            mkdir($this->dbPath.'/'.$collection, 0755, true);
        }

        $rows = array();

        if ($handle = opendir($this->dbPath.'/'.$collection)) {
            while (false !== ($entry = readdir($handle))) {
                if (! in_array($entry, array('.', '..'))) {
                    if (is_readable($pathToFile = $this->dbPath.'/'.$collection.'/'.$entry)) {
                        $match   = true;
                        $raw     = file_get_contents($pathToFile);
                        $content = json_decode($raw, true);

                        if (! is_null($criteria) and ! empty($criteria)) {
                            if (isset($criteria['!or'])) {
                                $string = reset(array_values(reset($criteria['!or'])));

                                if (! preg_match('/'.$string.'/', strtolower($raw))) {
                                    $match = false;
                                }
                            } else {
                                $intersection = array_intersect_assoc($content, $criteria);

                                if (empty($intersection)) {
                                    $match = false;
                                }
                            }

                        }

                        if ($match) {
                            $rows[] = $content;
                        }
                    }
                }
            }

            closedir($handle);
        }

        return $rows;
    }
211923
public static function get_metadata(collection $collection) : collection {
        $collection->add_database_table(
            'tool_dataprivacy_request',
            [
                'comments' => 'privacy:metadata:request:comments',
                'userid' => 'privacy:metadata:request:userid',
                'requestedby' => 'privacy:metadata:request:requestedby',
                'dpocomment' => 'privacy:metadata:request:dpocomment',
                'timecreated' => 'privacy:metadata:request:timecreated'
            ],
            'privacy:metadata:request'
        );

        $collection->add_user_preference(tool_helper::PREF_REQUEST_FILTERS,
            'privacy:metadata:preference:tool_dataprivacy_request-filters');
        $collection->add_user_preference(tool_helper::PREF_REQUEST_PERPAGE,
            'privacy:metadata:preference:tool_dataprivacy_request-perpage');

        return $collection;
    }
1079005
public static function getTypes($collection = false)
    {
        return array_merge($collection ? self::getCompoundTypes() : self::getSimpleTypes(), self::getEmptyTypes());
    }
435412
public static function get_metadata(collection $collection) : collection {
        $rolecapabilities = [
            'roleid' => 'privacy:metadata:role_capabilities:roleid',
            'capability' => 'privacy:metadata:role_capabilities:capability',
            'permission' => 'privacy:metadata:role_capabilities:permission',
            'timemodified' => 'privacy:metadata:role_capabilities:timemodified',
            'modifierid' => 'privacy:metadata:role_capabilities:modifierid'
        ];
        $roleassignments = [
            'roleid' => 'privacy:metadata:role_assignments:roleid',
            'userid' => 'privacy:metadata:role_assignments:userid',
            'timemodified' => 'privacy:metadata:role_assignments:timemodified',
            'modifierid' => 'privacy:metadata:role_assignments:modifierid',
            'component' => 'privacy:metadata:role_assignments:component',
            'itemid' => 'privacy:metadata:role_assignments:itemid'
        ];
        $collection->add_database_table('role_capabilities', $rolecapabilities,
            'privacy:metadata:role_capabilities:tableexplanation');
        $collection->add_database_table('role_assignments', $roleassignments,
            'privacy:metadata:role_assignments:tableexplanation');

        $collection->add_user_preference('definerole_showadvanced',
            'privacy:metadata:preference:showadvanced');

        return $collection;
    }
934407
public function match(RecordCollection $collection, RecordCollection $recordsLoaded)
    {
        $dictionary = $this->buildDictionary($recordsLoaded);

        foreach ($collection as $record) {
            /** @var Record $record */
            $results = $this->getResultsFromCollectionDictionary($dictionary, $collection, $record);
            /** @noinspection PhpUnhandledExceptionInspection */
            $record->getRelation($this->getName())->setResults($results);
        }

        return $recordsLoaded;
    }
201318
protected function errorLogs(array $collection)
    {
        $return = [
            'total_logs_count' => count($collection)
        ];
        $item   = [];
        foreach ($collection as $row) {
            $row  = array_except($row, 'date');
            $keys = array_keys($row);
            if (empty($item)) {
                $item = array_fill_keys($keys, 0);
            }
            foreach ($keys as $key) {
                $item[$key] += $row[$key];
            }
        }
        return $return + $item;
    }
94985
public function schemaCollection(SchemaCollection $collection = null)
    {
        deprecationWarning(
            'Connection::schemaCollection() is deprecated. ' .
            'Use Connection::setSchemaCollection()/getSchemaCollection() instead.'
        );
        if ($collection !== null) {
            $this->setSchemaCollection($collection);
        }

        return $this->getSchemaCollection();
    }
81311
public function get($collection)
    {
        $collection = $this->getCollectionNameFromInstance($collection);

        return isset($this->entries[$collection]) ? $this->entries[$collection] : null;
    }
167841
public function getLogsForTaskId($taskId): array
    {
        $logEntries = [];

        foreach (ImageResizer::$plugin->logs->getLogEntries() as $entry) {
            if ($entry->taskId == $taskId) {
                $logEntries[] = $entry;
            }
        }

        return $logEntries;
    }
1324244
public function get($collection = "")
		{

			$documents = $this->getCursor($collection);

			$returns = array();

			if ($documents && !empty($documents)) {
				foreach ($documents as $doc) {
					$returns[] = $doc;
				}
			}

			return $returns;
		}
73054
private function trackCollection(Collection $collection)
    {
        $blocks = $collection->getBlocks();
        $this->trackBlocks($collection, $blocks);
    }
529970
public function figures($collection)
    {
        $collection = $this->makeCollection($collection);
        $url        = UrlHelper::buildUrl(Urls::URL_COLLECTION, [$collection, self::OPTION_FIGURES]);
        $response   = $this->getConnection()->get($url);

        $data = $response->getJson();

        return $data[self::OPTION_FIGURES];
    }