Counts the number of rows in TinyMCE editor (row numbering starts with 1)

@param array $params TinyMCE init parameters array
@return int the maximum existing row number
506626
protected function count_button_rows(array &$params) {
        $maxrow = 1;
        foreach ($params as $key => $value) {
            if (preg_match('/^theme_advanced_buttons(\d+)$/', $key, $matches) &&
                    (int)$matches[1] > $maxrow) {
                $maxrow = (int)$matches[1];
            }
        }
        return $maxrow;
    }
671154
public function Count($param = '*'){
       $select = "select count($param)".$this->ProcessingTable();
       $sql = $this->StringSql($select);
       return (int) $this->query($sql)->one()["count($param)"];
   }
217497
public function sqlExecute(string $sql, array $params = []): int
    {
        return $this->connection()->sqlExecute($sql, $params);
    }
1217526
public static function counts($condition = null, $params = null, $distinct=false) {
        return static::dao()->count(
            $condition,
            $params,
            $distinct
        );
    }
1262646
public function numRows() {
        if ($this->numRows === null) {
            if (is_resource($this->hResult)) $this->numRows = mysql_num_rows($this->hResult);
            else                             $this->numRows = 0;
        }
        return $this->numRows;
    }
246769
public function index(array $params)
    {
        try {
            $directoryListing = $this->directoryListing($params);

            $count = count($directoryListing);

            /**
             * Remove Last 2 arrays
             */
            $output = array_slice(
                $directoryListing,
                0,
                $count - 2
            );

            /**
             * Paginate or Error if nothing found
             */
            if (is_array($directoryListing) && $count > '0') {
                $paginator = new Paginator(new ArrayAdapter($output));

                $paginator->setDefaultItemCountPerPage($count);
            } else {
                throw new \Exception(
                    $directoryListing . ' ' . $this->translate->translate(
                        'was not found',
                        'mp3'
                    )
                );
            }

            $path = (array_key_exists(
                'dir',
                $params
            ))
                ? $params['dir']
                : null;

            return [
                'paginator'     => $paginator,
                'path'          => $path,
                'totalLength'   => $directoryListing['totalLength'],
                'totalFileSize' => $directoryListing['totalFileSize'],
                'search'        => (is_file($this->getSearchFile()))
            ];
        } catch (\Exception $e) {
            throw $e;
        }
    }
1370138
public function get_events_select_count($selectwhere, array $params) {
        if (!$this->init()) {
            return 0;
        }

        if (!$dbtable = $this->get_config('dbtable')) {
            return 0;
        }

        return $this->extdb->count_records_select($dbtable, $selectwhere, $params);
    }
1040986
public function count($query, array $params = [])
    {
        $stmt = $this->connection->prepare($query);
        $stmt->execute($params);
        return $stmt->fetchColumn();
    }
1247133
public function queryRow($params = [])
    {
        $this->setLimit(1);
        return $this->getDb()
            ->createCommand()
            ->setText($this->buildSql())
            ->queryRow(array_merge($this->getParams(), $params));
    }
110412
public function insert($params)
    {
        if (is_array($params)) {
            $count_rows = count($params['columns']);
            $increment = 1;
            foreach ($params['columns'] as $keys => $value) {
                for ($i = 1; $i <= $count_rows; $i++) {
                    $data[$keys] = $value;
                }
            }
            foreach ($data as $keys => $values) {
                if ($increment == $count_rows) {
                    $columns[] = "{$keys} = '{$values}'";
                } else {
                    $columns[] = "{$keys} = '{$values}'";
                }
                $increment++;
            }
            $columns = implode(' , ', $columns);
            $query = "INSERT INTO `{$params['table']}`SET {$columns}";
            if (isset($params['debug']) and strtolower($params['debug']) === 'on') {
                var_dump($query);
            }

            return $query;
        } else {
            return false;
        }
    }
1216318
protected function checkMultipartParams( $params ) {
		foreach ( $params as $key => $val ) {
			if ( !is_array( $val ) ) {
				throw new Exception( "Parameter '$key' must be an array." );
			}
			if ( !in_array( $key, array_keys( $this->getParams() ) ) ) {
				throw new Exception( "Parameter '$key' is not already set on this request." );
			}
		}
	}
796285
public function getNumRows($resultSet){
		if($this->unbuffered)
			throw new DriverException('Cannot count rows on unbuffered result.');
		if($resultSet instanceof mysqli_result)
			return $resultSet->num_rows;
		return false;
	}
607533
private function describeCount($rows = null)
    {
        if ($rows === null) {
            $rows = $this->fetchTargetRows();
        }

        if (!is_array($rows) && !($rows instanceof Traversable)) {
            throw new InvalidArgumentException(
                sprintf(
                    'The rows must be iterable; received %s',
                    is_object($rows) ? get_class($rows) : gettype($rows)
                )
            );
        }

        $cli   = $this->climate();
        $model = $this->targetModel();

        if (is_array($rows) || $rows instanceof Countable) {
            $count = count($rows);
        } elseif ($rows instanceof PDOStatement) {
            $count = $rows->rowCount();
        } else {
            $count = iterator_count($rows);
        }

        if ($count === 0) {
            $cli->comment('The object table is empty.');
            $cli->comment(
                sprintf('Only changing `%s` column.', $model->key())
            );

            return false;
        } elseif ($count === 1) {
            if (!$this->quiet()) {
                $cli->comment('The object table has 1 row.');
            }
        } else {
            if (!$this->quiet()) {
                $cli->comment(
                    sprintf('The object table has %s rows.', $count)
                );
            }
        }

        return true;
    }
802758
public final function count(string $query = null, array $queryParams = null): ?int
    {
        $queryBuilder = new QueryBuilder($this->db->getLink());
        $queryBuilder->setTable($this->table);

        if ($query || $queryParams) {
            $queryBuilder->where($query, $queryParams);
        }

        return $queryBuilder->count();
    }
209581
public static function _count ($params = array (), &$db = FALSE)
	{
		
		// Remove order

		if (isset ($params['orderby']))
		{
			unset ($params['orderby']);
		}
		
		// Remove limit

		if (isset ($params['limit']))
		{
			unset ($params['limit']);
		}

		// Select count

		$params['select'] = 'COUNT(*)';
		
		// Return
		
		return static::_getValue ($params, \PDO::FETCH_ASSOC, $db);

	}
832269
public function setParamsSort(array $params) {
        if (is_numeric(key($params)) && key($params) == 0) {
            $tmp = [];
            foreach ($params as $key => $value) {
                $tmp[$key + 1] = $value;
            }
            $params = $tmp;
        }

        return $params;
    }
655591
public function count($params)
    {
    	$selectdb = new SelectDB($this->db);
		$selectdb->from($this->table);
		$selectdb->put($params);
		return $selectdb->count();
    }