Count the number of distinct given names (or the number of occurences of specific given names).

@param string[] ...$params

@return string
765144
public function totalGivennames(...$params): string
    {
        $query = DB::table('name')
            ->where('n_file', '=', $this->tree->id());

        if (empty($params)) {
            // Count number of distinct given names.
            $query
                ->distinct()
                ->where('n_givn', '<>', '@P.N.')
                ->whereNotNull('n_givn');
        } else {
            // Count number of occurences of specific given names.
            $query->whereIn('n_givn', $params);
        }

        $count = $query->count('n_givn');

        return I18N::number($count);
    }
1006783
public function count($conditions = '', $params = array()){
        return $this->db->builder()->select('COUNT(*)')->from($this->table)->where($conditions, $params)->queryValue();
    }
1202675
public function parameterize( $params )
	{
		foreach( $params as $key => $param )
		{
			$params[$key] = $this->param( $param );
		}

		return implode( ', ', $params );
	}
75006
public function index($params = [])
    {
        // Set the filters
        $params = (!empty($params))? $params : $this->app->request->input();

        // Get records
        $this->model->params = $params;
        $result = $this->model->search($params)->get();

        // Get pagination and number of records
        $pagination = array_merge(
            ['records' => $this->model->search($params)->count()],
            $this->model->pagination()
        );

        // Return results
        return [
            'success' => true,
            'paging' => $pagination,
            'data' => $result
        ];
    }
748150
private function locateParam($params, $param)
    {
        $value = null;
        $keys = explode('.', $param);
        for ($i = 0, $mx = count($keys); $i < $mx; $i++) {
            $key = $keys[$i];
            if (isset($params[$key])) {
                $value = $params[$key];
                if ((($i + 1) < $mx) && is_array($value)) {
                    return $this->locateParam($value, implode('.', array_slice($keys, $i)));
                }
            }
        }
        return $value;
    }
663487
public function singleton($params = array())
    {
        static $instances;
        if (!isset($instances)) {
            $instances = array();
        }
        $signature = serialize($params);
        if (!isset($instances[$signature])) {
            $instances[$signature] = Idna::getInstance($params);
        }
        return $instances[$signature];
    }
573809
protected function CreateFunctionCount(array $params, $alias = '', $distinctParams = false)
    {
        return FunctionCall::Count($this->connection, $params, $alias, $distinctParams);
    }
1073256
protected function extractCustomParams(array $params = array())
    {
        foreach ($params as $name => $values) {
            foreach ($this->services as $host => $service) {
                if (preg_match('~' . preg_quote($name, '~') . '~i', $service)) {
                    $this->customParams[$host] = (array) $values;
                }
            }
        }
    }
671154
public function Count($param = '*'){
       $select = "select count($param)".$this->ProcessingTable();
       $sql = $this->StringSql($select);
       return (int) $this->query($sql)->one()["count($param)"];
   }
341591
public function getAliases($params = [])
    {
        return $this->getClient()->indices()->getAliases(array_merge(['index' => $this->getIndexName()], $params));
    }
1057083
public function getCount($params = array())
    {
        $sourceRecords = $this->sourceRecords($params, null, null);
        if (!$sourceRecords instanceof SS_List) {
            user_error(static::class . "::sourceRecords does not return an SS_List", E_USER_NOTICE);
            return "-1";
        }
        return $sourceRecords->count();
    }
635431
public function queryAndCount(string $query, array $params = []): int
	{
		$prepared = $this->prepare($query, $params);

		$this->execute($prepared);

		return $prepared['statement']->rowCount();
	}
111740
protected function implodeParams(array $params)
    {
        $s = '';

        foreach ($params as $header => $value) {
            $s .= trim($header) . ": " . trim($value) . "\r\n";
        }

        return $s;
    }
222256
function FunctionCount(array $params, $alias = '', $distinctParams = false)
    {
        return parent::CreateFunctionCount($params, $alias, $distinctParams);
    }
1249147
protected function _parseApiParams($params)
  {
    $apiparams = [];
    if (count($params) === 0) {
      return $apiparams;
    }

    if (is_array($params[0])) {
      // given parameters are array
      $apiparams = $params[0];
      return $apiparams;
    }

    // user gave us query-style params
    parse_str($params[0], $apiparams);
    if (! is_array($apiparams)) {
      $apiparams = [];
    }

    return $apiparams;
  }
663090
public function unserializeParams($params) {
		$parts = explode($this->options['param-delimiter'], $params);
		$params = [];
		foreach ($parts as $part) {
			$kv = explode('=', $part);
			if ($kv[0] != '') {
				$value = count($kv) > 1
					? $kv[1] == $this->options['param-true'] ? true
					: ($kv[1] == $this->options['param-false'] ? false : $kv[1]) : true;
				$params = $this->setParam($params, $kv[0], $value);
			}
		}
		
		return $params;
	}
1226412
public static function hidden($params = array()) {

        if( !is_array($params) )
        {
            throw new \InvalidArgumentException("Arguments is not a Array". print_r($params, true));
        }

        $o = '<input type="hidden"';
        $o .= (isset($params['id'])) ? " id='{$params['id']}'" : '';
        $o .= (isset($params['name'])) ? " name='{$params['name']}'" : '';
        $o .= (isset($params['class'])) ? " class='{$params['class']}'" : '';
        $o .= (isset($params['value'])) ? " value='{$params['value']}'" : '';
        $o .= " />\n";
        return $o;
    }