Return all queued attachments that need processing.

@return array
332118
public function getQueuedAttachments()
    {
        $queued = [];

        foreach ($this->getMediaFiles() as $name => $attachment) {
            if ($attachment->isQueued()) {
                $queued[$name] = $attachment;
            }
        }

        return $queued;
    }
956
public function process_approved_deletions() : array {
        $this->trace->output('Checking requirements');
        if (!$this->check_requirements()) {
            $this->trace->output('Requirements not met. Cannot process expired retentions.', 1);
            return [0, 0];
        }

        $this->trace->output('Fetching all approved and expired contexts for deletion.');
        $expiredcontexts = expired_context::get_records(['status' => expired_context::STATUS_APPROVED]);
        $this->trace->output('Done.', 1);
        $totalprocessed = 0;
        $usercount = 0;
        $coursecount = 0;
        foreach ($expiredcontexts as $expiredctx) {
            $context = \context::instance_by_id($expiredctx->get('contextid'), IGNORE_MISSING);

            if (empty($context)) {
                // Unable to process this request further.
                // We have no context to delete.
                $expiredctx->delete();
                continue;
            }

            $this->trace->output("Deleting data for " . $context->get_context_name(), 2);
            if ($this->delete_expired_context($expiredctx)) {
                $this->trace->output("Done.", 3);
                if ($context instanceof \context_user) {
                    $usercount++;
                } else {
                    $coursecount++;
                }

                $totalprocessed++;
                if ($totalprocessed >= $this->get_delete_limit()) {
                    break;
                }
            }
        }

        return [$coursecount, $usercount];
    }
1145517
public function get_overall_feedback_attachments() {

        if ($this->workshop->overallfeedbackmode == 0) {
            return false;
        }

        if ($this->workshop->overallfeedbackfiles == 0) {
            return false;
        }

        if (empty($this->feedbackauthorattachment)) {
            return array();
        }

        $attachments = array();
        $fs = get_file_storage();
        $files = $fs->get_area_files($this->workshop->context->id, 'mod_workshop', 'overallfeedback_attachment', $this->id);
        foreach ($files as $file) {
            if ($file->is_directory()) {
                continue;
            }
            $filepath = $file->get_filepath();
            $filename = $file->get_filename();
            $fileurl = moodle_url::make_pluginfile_url($this->workshop->context->id, 'mod_workshop',
                'overallfeedback_attachment', $this->id, $filepath, $filename, true);
            $previewurl = new moodle_url(moodle_url::make_pluginfile_url($this->workshop->context->id, 'mod_workshop',
                'overallfeedback_attachment', $this->id, $filepath, $filename, false), array('preview' => 'bigthumb'));
            $attachments[] = (object)array(
                'filepath' => $filepath,
                'filename' => $filename,
                'fileurl' => $fileurl,
                'previewurl' => $previewurl,
                'mimetype' => $file->get_mimetype(),

            );
        }

        return $attachments;
    }
224055
public function getReplies()
    {
        $this->channel
            ->basic_consume(
                $this->queueName,
                $this->queueName,
                false,
                true,
                false,
                false,
                array($this, 'processMessage')
            );

        while (count($this->replies) < $this->requests) {
            $this->channel
                ->wait(null, false, $this->requestTimeout);
        }

        $this->channel
            ->basic_cancel($this->queueName);

        return $this->replies;
    }
1157110
private function processes()
    {
        return collect($this->supervisors->all())->pluck('processes')->reduce(function ($final, $queues) {
            foreach ($queues as $queue => $processes) {
                $final[$queue] = isset($final[$queue]) ? $final[$queue] + $processes : $processes;
            }

            return $final;
        }, []);
    }
1097475
public function getAll()
    {
        if (filesize($this->filename) <= static::MAX_FILE_SIZE_FOR_CACHE) {
            $return = $this->query(new Query());
        } else {
            $return = $this->getIterator();
        }

        return $return;
    }
310548
public function getAll(){
        $rest = $this->getService( self::API_UPLOAD);
        $rest->GET();

        return $rest->getResultAsArray( models\FileSystem\FileUpload::class);
    }
111047
public function matchesRequest()
    {
        $noAttachments = Collection::make($this->event->get('attachments'))->isEmpty();

        return $noAttachments && (! is_null($this->event->get('recipient')) && ! is_null($this->event->get('serviceUrl')));
    }
496918
def get_sorted_attachments(self):
        
        inf = float("inf")
        order = self.get_attachments_order()
        attachments = self.get_attachments()

        def att_cmp(att1, att2):
            _n1 = att1.get('UID')
            _n2 = att2.get('UID')
            _i1 = _n1 in order and order.index(_n1) + 1 or inf
            _i2 = _n2 in order and order.index(_n2) + 1 or inf
            return cmp(_i1, _i2)

        sorted_attachments = sorted(attachments, cmp=att_cmp)
        return sorted_attachments
291726
public function getAll()
    {
        $listeners = [];

        // Get a clone of the queue.
        $queue = $this->getIterator();

        foreach ($queue as $listener) {
            $listeners[] = $listener;
        }

        return $listeners;
    }
773427
public function getFiles()
    {
        $files = array();
        while ($this->valid() && $this->isFile()) {
            if (!$this->searchPattern) {
                $files[] = $this->current();
            } elseif(preg_match($this->searchPattern, $this->getFilename())) {
                $files[] = $this->current();
            }
            $this->next();
        }
        return $files;
    }
869446
public function attachmentMessages()
    {
        $result = [];
        foreach ($this->entries as $entry) {
            foreach ($entry->messages as $entryMessage) {
                if ($entryMessage->isMessage) {
                    if ($entryMessage->message->hasAttachments) {
                        $result[] = $entryMessage->message;
                    }
                }
            }
        }
        return collect($result);
    }
198411
public function getStatusesHuman()
    {
        return [
            self::STATUS_PENDING          => 'Pending',
            self::STATUS_PROCESSING       => 'Processing',
            self::STATUS_COMPLETE         => 'Complete',
            self::STATUS_FAILED           => 'Failed',
            self::STATUS_REFUNDED         => 'Refunded',
            self::STATUS_REFUNDED_PARTIAL => 'Partially Refunded',
        ];
    }
230180
public static function getProperties()
    {
        return [
            'AttachmentID' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
            'FileName' => [true, self::PROPERTY_TYPE_STRING, null, false, false],
            'Url' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
            'MimeType' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
            'ContentLength' => [false, self::PROPERTY_TYPE_INT, null, false, false],
        ];
    }
1278066
public function pruneTerminatingProcesses()
    {
        $this->stopTerminatingProcessesThatAreHanging();

        $this->terminatingProcesses = collect(
            $this->terminatingProcesses
        )->filter(function ($process) {
            return $process['process']->isRunning();
        })->all();
    }
218538
public function getFileHandlersAsArray()
    {

        // initialize the array for the file handlers
        $fileHandlers = array();

        // iterate over the file handlers nodes and sort them into an array
        /** @var \AppserverIo\Appserver\Core\Api\Node\FileHandlerNode $fileHandler */
        foreach ($this->getFileHandlers() as $fileHandler) {
            $fileHandlers[$fileHandler->getExtension()] = array(
                'name' => $fileHandler->getName(),
                'params' => $fileHandler->getParamsAsArray()
            );
        }

        // return what we got
        return $fileHandlers;
    }
755336
public function resolveQueues()
    {
        if (in_array('*', $this->queues)) {
            $queues = $this->redis->smembers(Queue::redisKey());
            is_array($queues) and sort($queues);
        } else {
            $queues = $this->queues;
        }

        if (!is_array($queues)) {
            $queues = array();
        }

        return $queues;
    }