Retrieves the number of select options in the element. If the element
isn't present or a select, the returned response will be negative 1.

@return Integer: how many select options are available in the select
element
546089
public int numOfSelectOptions() {
        if (isNotPresentSelect()) {
            return -1;
        }
        WebElement webElement = element.getWebElement();
        Select dropdown = new Select(webElement);
        List<WebElement> options = dropdown.getOptions();
        return options.size();
    }
216325
protected static function makeSelect()
    {
        $self   = self::getInstance();
        $select = (!empty($self->optionSelect)) ? $self->optionSelect : "*";

        return "SELECT {$select} FROM {$self->table_name} ";
    }
489455
public function get()
    {
        if ($this->isInteger()) {
            /** @noinspection PhpUndefinedMethodInspection */
            return $this->value['num']->get();
        }

        $num = intval(gmp_strval($this->value['num']->gmp()));
        $den = intval(gmp_strval($this->value['den']->gmp()));

        return $num/$den;
    }
1168175
public function num_rows()
	{
		if (is_int($this->num_rows))
		{
			return $this->num_rows;
		}
		elseif (count($this->result_array) > 0)
		{
			return $this->num_rows = count($this->result_array);
		}
		elseif (count($this->result_object) > 0)
		{
			return $this->num_rows = count($this->result_object);
		}
		elseif (($num_rows = $this->result_id->rowCount()) > 0)
		{
			return $this->num_rows = $num_rows;
		}

		return $this->num_rows = count($this->result_array());
	}
1315656
public function count(): int
    {
        $amount = 0;
        // iterate with $key so the key consumer from peek() can have a look
        foreach ($this->elements as $key => $element) {
            $amount++;
        }

        return $amount;
    }
159015
public function maybeShowOptionNone()
    {
        if (isset($this->args['show_option_none']) && ! Cuztom::isEmpty($this->args['show_option_none'])) {
            return '<option value="-1" '.(Cuztom::isEmpty($this->value) ? 'selected="selected"' : '').'>'.$this->args['show_option_none'].'</option>';
        }
    }
1126438
public function count(): ?int
    {
        // no where, count all simply
        $where = $this->query['where'] ?? null;
        if ($where == null) {
            return $this->agent->count($this->table);
        }

        $from = '';
        if ($this->query) {
            $isSub = $this->isSub;
            $this->isSub = true;
            $from = $this->toString();
            $this->isSub = $isSub; // restore
        }

        if ($from == '') {
            $from = "SELECT 1 FROM {$this->table} ". trim($this->toQueryString('where', false));
        }
        $from = trim($from);

        $query = "SELECT count(*) AS count FROM (\n\t{$from}\n) AS tmp";
        $result = $this->agent->get($query, null, 'object');

        return isset($result->count) ? intval($result->count) : null;
    }
440690
public function count() {
		if(!$this->initialized)
			$this->initialize();

		return count($this->elements) - count($this->toRemove) + count($this->toAdd);
	}
115607
public function getNbAds()
    {
        $nbAds = $this->node
            ->filter('a.tabsSwitch span.tabsSwitchNumbers')
            ->first();

        if ($nbAds->count()) {
            $nbAds = preg_replace('/\s+/', '', $nbAds->text());
            return (int) $nbAds;
        }

        return 0;
    }
1006178
public function getOptions()
    {
        $res = [];
        foreach ($this->getOptionArray() as $index => $value) {
            $res[] = ['value' => $index, 'label' => $value];
        }
        return $res;
    }
833906
private function get_number_of_questions_to_add_choices() {
        $maxrand = 100;
        $randomcount = array();
        for ($i = 1; $i <= min(10, $maxrand); $i++) {
            $randomcount[$i] = $i;
        }
        for ($i = 20; $i <= min(100, $maxrand); $i += 10) {
            $randomcount[$i] = $i;
        }
        return $randomcount;
    }
1079028
public function getNumbers()
    {
        return (string) \OxidEsales\Eshop\Core\Str::getStr()->substr($this->_cleanUp($this->_sCompanyVatNumber), 2);
    }
940616
public function get_num_options(){
    /** @var  $paths takes all options with i18n property setted*/
    $paths = options::get_instance()->find_i18n();

    $data = [];
    /**
    * creates the property data_widget that will have just num of items found for the option + 1 (the text of the option parent), the * * number of strings translated and the source language indexed to the language
    */
    $primaries = $this->get_primaries_langs();
    foreach ($primaries as $p ){
      $configured_langs[] = $p['code'];
    }
    foreach ( $paths as $p => $val){
      $parent = options::get_instance()->get_id_parent($paths[$p]['id']);

      foreach ( $configured_langs as $lang ) {
        $count = 0;
        $items = $paths[$p]['items'];
        /** push the text of the option into the array of strings */
        $items[] = [
          'id' => $paths[$p]['id'],
          'text' => $paths[$p]['text'],
          'id_parent' => $parent
        ];
        foreach ( $items as $idx => $item ){
          if ( $id = $this->db->select_one('bbn_i18n', 'id', [
            'exp'=> $item['text'],
            'lang' => $paths[$p]['language']
          ])){
            if ( $this->db->select_one('bbn_i18n_exp', 'id_exp', [
              'id_exp' => $id,
              'lang' => $lang
            ]) ){
              $count ++;
            }
          }
        }
        $paths[$p]['data_widget']['result'][$lang] = [
          'num' => count($items),
          'num_translations' => $count,
          'lang' => $lang
        ];
      }
      $paths[$p]['data_widget']['locale_dirs'] = [];

      unset($paths[$p]['items']);
      $data[] = $paths[$p];
    }
    return [
      'data'=> $data
    ];
  }
13086
public function getEnumerations()
    {
        $enums = array();
        foreach ($this->element->getElementsByTagName('enumeration') as $enum) {
            $enums[] = $enum->getAttribute('value');
        };
        return $enums;
    }
1133318
function getSelectValue (elem) {
  var value, option, i
  var options = elem.options
  var index = elem.selectedIndex
  var one = elem.type === 'select-one'
  var values = one ? null : []
  var max = one ? index + 1 : options.length

  if (index < 0) {
    i = max
  } else {
    i = one ? index : 0
  }

  // Loop through all the selected options
  for (; i < max; i++) {
    option = options[i]

    // Support: IE <=9 only
    // IE8-9 doesn't update selected after form reset
    if ((option.selected || i === index) &&

        // Don't return options that are disabled or in a disabled optgroup
        !option.disabled &&
        (!option.parentNode.disabled ||
          option.parentNode.tagName.toLowerCase() === 'optgroup')) {
      // Get the specific value for the option
      value = option.value

      // We don't need an array for one selects
      if (one) {
        return value
      }

      // Multi-Selects return an array
      values.push(value)
    }
  }

  return values
}
546567
public function getElementId()
    {
        if (null === $this->elementId && null !== $this->element) {
            $this->elementId = $this->element->id;
        }

        return $this->elementId;
    }
1238844
protected function getOptions()
	{
		$options = array();

		$select = new HtmlSelect;

		// Try to inject the text object into the field
		try
		{
			$select->setText($this->getText());
		}
		catch (\RuntimeException $exception)
		{
			// A Text object was not set, ignore the error and try to continue processing
		}

		/** @var \SimpleXMLElement $option */
		foreach ($this->element->children() as $option)
		{
			// Only add <option /> elements.
			if ($option->getName() != 'option')
			{
				continue;
			}

			$text = $this->translateOptions
				? $this->getText()->alt(trim((string) $option), preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname))
				: trim((string) $option);

			// Create a new option object based on the <option /> element.
			$tmp = $select->option((string) $option['value'], $text, 'value', 'text', ((string) $option['disabled'] == 'true'));

			// Set some option attributes.
			$tmp->class = (string) $option['class'];

			// Set some JavaScript option attributes.
			$tmp->onclick = (string) $option['onclick'];

			// Add the option object to the result set.
			$options[] = $tmp;
		}

		reset($options);

		return $options;
	}