Defines the number of named parameters using the model naming
convention: id=x or id1=x id2=y

@see setNamedParamenters()

@param int $idCount The number of parameters to define
@return \Gems_Menu_SubMenuItem (continuation pattern)
187491
public function setModelParameters($idCount)
    {
        $params = array();
        if (1 == $idCount) {
            $params[\MUtil_Model::REQUEST_ID] = \MUtil_Model::REQUEST_ID;
        } else {
            for ($idx = 1; $idx <= $idCount; $idx++) {
                $params[\MUtil_Model::REQUEST_ID . $idx] = \MUtil_Model::REQUEST_ID . $idx;
            }
        }
        $this->setNamedParameters($params);

        return $this;
    }
1284089
public function setId($parameterIndex, ObjectIdInterface $id)
    {
        $this->setParameter($parameterIndex, $this->escape($id->getId()));
    }
481214
public function count($mode = COUNT_NORMAL)
    {
        if($mode == COUNT_RECURSIVE)
        {
            $count = 0;
            $data  = $this->__options;
            foreach ($data as $key => $value)
            {
                if(is_array($value) || $value instanceof KObjectConfig)
                {
                    if ($value instanceof KObjectConfigInterface) {
                        $count += $value->count($mode);
                    } else {
                        $count += count($value);
                    }
                }
            }
        }
        else $count = count($this->__options);

        return $count;
    }
771267
protected function setCounter($type, $counter)
	{
		if ($type === 'hotp')
		{
			if ($counter !== 0 && empty($counter))
			{
				throw new \InvalidArgumentException("Counter can't be empty if HOTP is being used");
			}

			$this->parameters .= "&counter=$counter";
		}
	}
798225
public function incrementAndInvoice($count = 1)
    {
        $this->incrementQuantity($count);

        $this->user->invoice(['subscription' => $this->stripe_id]);

        return $this;
    }
348556
@Override
  public long executeCount(CommandContext commandContext) {
    checkQueryOk();
    DbReadOnlyIdentityServiceProvider identityProvider = getIdentityProvider(commandContext);
    return identityProvider.findTenantCountByQueryCriteria(this);
  }
1170027
protected function _fetchCount(Identity $identity)
    {
        $this->_totalItemsCount = $this->_db->fetchOne($this->_getSelectCount($identity));
        return $this;
    }
792599
public function setNext($param1, $param2 = null)
    {
        if($this->closed)
        {
            throw new LogicException('Boundary has been already closed.');
        }

        $numberOfArgs = func_num_args();
        
        if($numberOfArgs === 2)
        {
            $point = Point::getInstance($param1, $param2);
        }
        elseif($param1 instanceof Point)
        {
            $point = $param1;
        }
        else
        {
            throw new InvalidArgumentException('Passed argument(s) should be coordinations or Point object.');
        }

        $oldNumberOfPoints = $this->numberOfPoints;
        $this->points[$oldNumberOfPoints] = $point;
        $this->numberOfPoints++;

        $diagonalPoint = $this->getDiagonalPoint();

        if(!$diagonalPoint || $diagonalPoint->compareYCoord($point) >= 0)
        {
            $this->diagonalPointYIndex = $oldNumberOfPoints;
        }
        
        if(!$diagonalPoint || $diagonalPoint->compareXCoord($point) <= 0)
        {
            $this->diagonalPointXIndex = $oldNumberOfPoints;
        }

        return $this;
    }
587147
protected function get_sql_and_params($count = false) {
        $fields = 'uca.id, uca.cohortid, uca.userid, uca.roleid, ';
        $fields .= 'c.name as cohortname, c.idnumber as cohortidnumber, c.contextid as cohortcontextid, ';
        $fields .= 'c.visible as cohortvisible, c.description as cohortdescription, c.theme as cohorttheme, ';

        // Add extra user fields that we need for the graded user.
        $extrafields = get_extra_user_fields($this->context);
        foreach ($extrafields as $field) {
            $fields .= 'u.' . $field . ', ';
        }
        $fields .= get_all_user_name_fields(true, 'u');

        if ($count) {
            $select = "COUNT(1)";
        } else {
            $select = "$fields";
        }

        $sql = "SELECT $select
                   FROM {tool_cohortroles} uca
                   JOIN {user} u ON u.id = uca.userid
                   JOIN {cohort} c ON c.id = uca.cohortid";
        $params = array();

        // Add order by if needed.
        if (!$count && $sqlsort = $this->get_sql_sort()) {
            $sql .= " ORDER BY " . $sqlsort;
        }

        return array($sql, $params);
    }
1166803
public function setCount(int $count, string $type = self::INFO): void
	{
		if ($count > 0) {
			switch ($type) {
				default:
					throw new InvalidArgumentException("Wrong argument 'type'");
				case self::INFO:
				case self::WARNING:
					break;
			}
			$this->count = $count;
			$this->type = $type;
		}
	}
634737
public function assignChild ($relationIdentifier, $id, $childId)
		{
			$relation = $this->getRelation($relationIdentifier);

			if (!$relation) {
				throw new RelationException('Invalid relation `' . $relationIdentifier);
			}

			if ($relation instanceof OneToMany) {
				$this->database->createQuery()
					->update()
					->table($relation->getRelatedTable())
					->set(
						array(
							$relation->getRelatedKey() => $id,
						)
					)
					->whereEqual($relation->getKey(), $childId)
					->execute();
			} else if ($relation instanceof ManyToMany) {
				if (! $this->getChild($relationIdentifier, $id, $childId)) {
					$this->database->createQuery()
						->insert()
						->into($relation->getRelationalTable())
						->set(
							array(
								$relation->getKey()         => $id,
								$relation->getRelatedKey()  => $childId,
							)
						)
						->execute();
				}
			} else {
				throw new RelationException('Invalid relation type `' . gettype($relation) . '`');
			}
		}
492114
public int setCount(double dFieldCount, boolean bDisableListeners, int iMoveMode)
    {
        int iErrorCode = DBConstants.NORMAL_RETURN;
        if (m_fldMain != null)
        {
            boolean[] rgbEnabled = null;
            if (bDisableListeners)
                rgbEnabled = m_fldMain.setEnableListeners(false);
            int iOriginalValue = (int)m_fldMain.getValue();
            boolean bOriginalModified = m_fldMain.isModified();
            int iOldOpenMode = m_fldMain.getRecord().setOpenMode(m_fldMain.getRecord().getOpenMode() & ~DBConstants.OPEN_REFRESH_AND_LOCK_ON_CHANGE_STRATEGY); // don't trigger refresh and write
            iErrorCode = m_fldMain.setValue(dFieldCount, true, iMoveMode); // Set in main file's field if the record is not current
            m_fldMain.getRecord().setOpenMode(iOldOpenMode);
            if (iOriginalValue == (int)m_fldMain.getValue())
                if (bOriginalModified == false)
                    m_fldMain.setModified(bOriginalModified);   // Make sure this didn't change if change was just null to 0.
            if (rgbEnabled != null)
                m_fldMain.setEnableListeners(rgbEnabled);
        }
        return iErrorCode;
    }
188804
public void incrementCount2D(K first, K second, double count) {
    if (depth != 2) {
      wrongDepth(); //throws exception
    }

    this.addToTotal(count);
    GeneralizedCounter<K> next = this.conditionalizeHelper(first);
    next.incrementCount1D(second, count);
  }
531474
public function count($count = null)
    {
        if ($count === null) {
            return isset($this->options['count']) ? $this->options['count'] : 0;
        } else {
            $this->options['count'] = $count;
            return $this;
        }
    }
1268463
public function getCounter($id, Models\CounterParams $params)
    {
        $resource = 'counter/' . $id;
        $response = $this->sendGetRequest($resource, $params->toArray());
        $counter = new Models\GetCounterResponse($response);
        return $counter->getCounter();
    }
115306
protected function mergeNameAndAliasCount(array $args, $name, $alias) {
        if ( ! array_has($args, 'options')) {
            return $args;
        }

        $namedCount = array_take($args, s('options.%s', $name), 0);
        $aliasedCount = array_take($args, s('options.%s', $alias), 0);
        $totalCount = $namedCount + $aliasedCount;

        if ($name) {
            array_set($args, s('options.%s', $name), $totalCount);
        } else {
            array_set($args, s('options.%s', $alias), $totalCount);
        }

        return $args;
    }
387296
public function setRowsCount($rowsCount, $colsCount=NULL, $force=false) {
		$count=$this->count();
		if ($rowsCount < 2 && $force === false) {
			for($i=$count; $i < $colsCount; $i++) {
				$this->addItem(new HtmlGridCol("col-" . $this->identifier . "-" . $i));
			}
		} else {
			if ($this->hasOnlyCols($count)) {
				$tmpContent=$this->content;
				$item=$this->addItem($colsCount);
				$item->setContent($tmpContent);
				$this->content=array ();
				$count=1;
			}
			for($i=$count; $i < $rowsCount; $i++) {
				$this->addItem($colsCount);
			}
		}
		return $this;
	}