Determines which choice(s) were chosen by form submission, given the selected
slug(s).

@param mixed $slugs
@return ChoiceInterface|ChoiceInterface[]
960360
protected function parseChoiceSlugs($slugs)
    {
        if ($this->getType() === static::TYPE_CHOICE || (bool)($slugs) === false) {
            $slugs = [$slugs];
        }

        $result = [];
        foreach ($this->getChoices() as $slug => $choice) {
            if (in_array($slug, $slugs) === true) {
                $result[] = $choice;
            }
        }

        if ($this->getType() === static::TYPE_CHOICE && $result !== []) {
            $result = $result[0];
        }

        return $result;
    }
262668
protected function getSelectedForAllAliases(array $aliases)
    {
        if (empty($aliases)) {
            $selected = $this->mergeOrderByAttributes($this->getSelectedQueryAttributes($this->operation->getAttributes()));
        } else {
            // If there are aliases, then we need to loop through each one to determine was was actually selected for each.
            $selected = [];
            foreach ($aliases as $alias => $schema) {
                $selected = array_replace(
                    $selected,
                    $this->mergeOrderByAttributes($this->getSelectedQueryAttributes($this->operation->getAttributes(), $schema), $alias)
                );
            }
        }

        return $selected;
    }
590086
public function choicesForValue(array $values = []): array
    {
        $choices = $this->choices();
        $selected = [];
        foreach ($values as $value) {
            if (array_key_exists($value, $this->choices)) {
                $selected[$value] = $choices[$value];
            }
        }

        return $selected;
    }
81558
public static function get( $slug ) {
		return isset( self::$queues[ $slug ] ) ? self::$queues[ $slug ] : null;
	}
896115
public function getImageSetBySlug($slug)
    {
        $imageSet = $this->getImageSet();
        foreach ($imageSet as $set) {
            if ($set->slug == $slug) {
                return $set;
            }
        }

        return null;
    }
319322
public function getChoices(Options $options)
    {
        if (!$options['category'] instanceof CategoryInterface) {
            return [];
        }

        if (null === $options['context']) {
            $categories = $this->manager->getAllRootCategories();
        } else {
            $categories = $this->manager->getRootCategoriesForContext($options['context']);
        }

        $choices = [];

        foreach ($categories as $category) {
            $choices[$category->getId()] = sprintf('%s (%s)', $category->getName(), $category->getContext()->getId());

            $this->childWalker($category, $options, $choices);
        }

        return $choices;
    }
193628
public function slugs()
    {
        $slugs = collect();

        $this->all()->each(function ($item, $key) use ($slugs) {
            $slugs->push(strtolower($item['slug']));
        });

        return $slugs;
    }
336297
public static function grab($slug)
    {
        /*
         * Comment out prior to 0.2 launch. Will cause massive amount
         * of Database queries. Only for adding new settings while
         * in development and testing.
         */
        //       Cache::flush();

        $setting = Cache::remember('ticketit::settings.'.$slug, 60, function () use ($slug) {
            $settings = Cache::remember('ticketit::settings', 60, function () {
                return Table::all();
            });

            $setting = $settings->where('slug', $slug)->first();

            if ($setting->lang) {
                return trans($setting->lang);
            }

            if (self::is_serialized($setting->value)) {
                $setting = unserialize($setting->value);
            } else {
                $setting = $setting->value;
            }

            return $setting;
        });

        return $setting;
    }
1023708
public function get_post_type_by_slug( $slug ) {
		if ( ! isset( $this->_custom_posts_mapper[ $slug ] ) ) {
			return null;
		}

		return $this->get_custom_post_type( $this->_custom_posts_mapper[ $slug ] );
	}
554470
public function resolveRouteBinding($slug){
		$id = static::decodeSlug($slug);
		return parent::where($this->getKeyName(), $id)->first();
	}
984014
public static function getStringOperandsChoices()
    {
        $choices = array();

        $reflection = new \ReflectionClass(__CLASS__);
        foreach ($reflection->getConstants() as $name => $value) {
            if ('STRING_' === substr($name, 0, 7)) {
                $choices[$value] = strtolower(str_replace('STRING_', 'text.', $name));
            }
        }

        return array_flip($choices);
    }
740264
private function getSelectedIndexChoices(array $answers) : array
    {
        $selectedChoices = [];

        foreach ($answers as $answer) {
            if (!ctype_digit($answer)) {
                throw new InvalidArgumentException('Answer is not an integer');
            }

            $answer = (int)$answer;

            if ($answer < 1 || $answer > count($this->choices)) {
                throw new InvalidArgumentException('Choice must be between 1 and ' . count($this->choices));
            }

            // Answers are 1-indexed
            $selectedChoices[] = $this->choices[$answer - 1];
        }

        return $selectedChoices;
    }
194286
protected function selector(&$choices = null)
    {
        $choices = $choices ? $choices : $this->choices;
        $choices = $this->userEditor->getChoicesAsEmailUsername($choices);
        $question = new ChoiceQuestion(static::PLEASE_SELECT_A_USER, $choices);
        $selectedUser = $this->ask($question);
        $user = $this->getChoiceBySelection($selectedUser);
        if ($user) {
            $this->editor($user);
        }
    }
53598
public function getFormOptions($options = []) {
		if (empty($options) || !is_array($options)) {
			$options = [];
		}

		$optionsDefault = $this->_getOptionsForElem('form');
		$result = $optionsDefault + $options;

		return $result;
	}
343965
public function getChoicesAsSeparateEmailUsername(array &$choices)
    {
        $ret = [];
        foreach ($choices as $item) {
            $ret[] = $item->getEmail();
            $ret[] = $item->getUsername();
        }

        return $ret;
    }
1330209
public function getChoices($opts = [])
    {
        $include_blank_dash = (array_key_exists('include_blank', $opts)) ?
            false == $opts['include_blank'] : true;

        $first_choice = [];
        if ($include_blank_dash) {
            $first_choice = self::BLANK_CHOICE_DASH;
        }

        if (!empty($this->choices)) {
            return array_merge($first_choice, $this->choices);
        }

        // load from relationships todo
    }
1357798
protected function parseChoices(array $choices)
    {
        $parsed = [];
        foreach ($choices as $choiceIdent => $choice) {
            $choice = $this->parseChoice($choice, (string)$choiceIdent);
            $choiceIdent = $choice['value'];

            $parsed[$choiceIdent] = $choice;
        }

        return $parsed;
    }