Alcaeus\MongoDbAdapter\AbstractCursor::getOptions PHP Method

getOptions() protected method

Applies all options set on the cursor, overwriting any options that have already been set
protected getOptions ( array $optionNames = null ) : array
$optionNames array Array of option names to be applied (will be read from properties)
return array
    protected function getOptions($optionNames = null)
    {
        $options = [];
        if ($optionNames === null) {
            $optionNames = $this->optionNames;
        }
        foreach ($optionNames as $option) {
            $converter = 'convert' . ucfirst($option);
            $value = method_exists($this, $converter) ? $this->{$converter}() : $this->{$option};
            if ($value === null) {
                continue;
            }
            $options[$option] = $value;
        }
        return $options;
    }