Load a particular set of values for each dataset used by this question.
@param int $itemnumber which set of values to load.
0 < $itemnumber <= {@link get_number_of_items()}.
@return array name => value.
332205
public function get_values($itemnumber) {
        if ($itemnumber <= 0 || $itemnumber > $this->get_number_of_items()) {
            $a = new stdClass();
            $a->id = $this->questionid;
            $a->item = $itemnumber;
            throw new moodle_exception('cannotgetdsfordependent', 'question', '', $a);
        }

        return $this->load_values($itemnumber);
    }
56594
public function getValue($item, $columnName)
    {
        if ($columnName == 'domain' && !$item->getDomain()) {
            return 'All domains';
        }

        return parent::getValue($item, $columnName);
    }
426603
public function findFromLocalReferenceId($localId, $itemType)
    {
        /** @var $item IAmazonReferenceId */
        foreach ($this->idLists[$itemType] as $item) {
            if ($localId === $item->getLocalId()) {
                reset($this->idLists);

                return $item;
            }
        }

        return null;
    }
130268
public function set($sectionName, $itemName, $itemValue)
    {
        $section = $this->getSection($sectionName);
        $section->set($itemName, $itemValue);

        return $this;
    }
258499
public function set($itemName, $itemValue)
    {
        list($validationResult, $message) = IniParser::i()->validateItemName($itemName);
        if (false === $validationResult)
        {
            throw new InvalidDataException($message);
        }
        $this->contents[$itemName] = IniParser::i()->itemValuetoStringRepresentation($itemValue);

        return $this;
    }
1211054
private function getDataFromItem($item)
    {
        if (!is_object($item) && !is_array($item)) {
            return array();
        }

        return is_object($item) ? get_object_vars($item) : $item;
    }
31616
public static function fromString($itemValue)
    {
        $bits = preg_split(
            '/\s*(?:;*("[^"]+");*|;*(\'[^\']+\');*|;+)\s*/',
            $itemValue,
            0,
            PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE
        );
        $value = array_shift($bits);
        $attributes = array();

        $lastNullAttribute = null;
        foreach ($bits as $bit) {
            if (($start = substr($bit, 0, 1)) === ($end = substr($bit, -1)) &&
                ('"' === $start || '\'' === $start)) {
                $attributes[$lastNullAttribute] = substr($bit, 1, -1);
            } elseif ('=' === $end) {
                $lastNullAttribute = $bit = substr($bit, 0, -1);
                $attributes[$bit] = null;
            } else {
                $parts = explode('=', $bit);
                $attributes[$parts[0]] = isset($parts[1]) && strlen($parts[1]) > 0 ? $parts[1] : '';
            }
        }

        return new self(($start = substr($value, 0, 1)) === ($end = substr($value, -1)) &&
        ('"' === $start || '\'' === $start) ? substr($value, 1, -1) : $value, $attributes);
    }
504779
public function getSimilarItems($items, $itemCount = 3)
    {
        if (!is_array($items)) {
            $items = [$items];
        }

        $response = $this->sendQuery(['items' => $items, 'num' => intval($itemCount)]);

        return $response;
    }
804455
public function toArray($is_numeric_index = true ,$itemToArray = false)
    {

        $array = array();
        foreach ($this->_items as $item) {
            if (!$is_numeric_index) {
                $id = (string) $item->getId();
                if ($itemToArray) {
                    $item = $item->toArray();
                }
                $array[$id] = $item;
            } else {
                if ($itemToArray) {
                    $item = $item->toArray();
                }
                $array[] = $item;
            }
        }

        return $array;

    }
843728
public function itemValue() {
    $itemprop = $this->itemProp();
    if (empty($itemprop))
      return null;
    if ($this->itemScope()) {
      return $this;
    }
    switch (strtoupper($this->tagName)) {
      case 'META':
        return $this->getAttribute('content');
      case 'AUDIO':
      case 'EMBED':
      case 'IFRAME':
      case 'IMG':
      case 'SOURCE':
      case 'TRACK':
      case 'VIDEO':
        // @todo Should this test that the URL resolves?
        return $this->getAttribute('src');
      case 'A':
      case 'AREA':
      case 'LINK':
        // @todo Should this test that the URL resolves?
        return $this->getAttribute('href');
      case 'OBJECT':
        // @todo Should this test that the URL resolves?
        return $this->getAttribute('data');
      case 'DATA':
        return $this->getAttribute('value');
      case 'TIME':
        $datetime = $this->getAttribute('datetime');
        if (!empty($datetime))
          return $datetime;
      default:
        return $this->textContent;
    }
  }
799476
public function getItemCount()
    {
        if (null === $this->itemCount) {
            $this->itemCount = (int) $this->paginator->count();
        }

        return $this->itemCount;
    }
1033267
public function getRequiredNumber()
    {
        $count = $this->requiredCount - count($this->items);

        // if we have more than we need, then we require 0
        if ($count < 0) {
            $count = 0;
        }

        return $count;
    }
1351229
public function indexOf($itemID)
    {
        $cnt = parent::count();
        for ($i = 0; $i < $cnt; $i++) {
            if ($this->items[$i]->id == $itemID) {
                return $i;
            }
        }

        return -1;
    }
509476
private function mapItemsAsJson(array $itemList)
    {
        $response = array();
        foreach ($itemList as $item) {
            $response[$item->id] = array('id' => $item->id, 'name' => $item->GetNameSEO(), 'url' => $item->getLink());
        }

        return $response;
    }
198011
protected function doLoad($itemMetaData)
	{
		$query = $this->newQueryInstance($itemMetaData);
		$databaseMapping = $this->ormDriver->loadDatabaseMapping($itemMetaData);
		$query->mapDatabase($databaseMapping, $itemMetaData->getItemClass(), $itemMetaData->getHitPositions());
		return $query;
	}
448336
function setIteratorValues( $item, $key, $index, $number, $sequence, &$last )
    {
        $this->InternalAttributes['item'] = $item;
        $this->InternalAttributes['key'] = $key;
        $this->InternalAttributes['index'] = $index;
        $this->InternalAttributes['number'] = $number;
        $this->InternalAttributes['sequence'] = $sequence;
        $this->InternalAttributes['last'] = $last;
    }
210727
public function getItemByUser($itemName, $userId)
    {
        if (empty($userId)) {
            return [];
        }

        $query = (new Query)->select('b.*')
            ->from(['a' => $this->assignmentTable, 'b' => $this->itemTable])
            ->where('{{a}}.[[item_name]]={{b}}.[[name]]')
            ->andWhere(['{{a}}.[[item_name]]' => (string) $itemName, 'a.user_id' => (string) $userId]);

        $role = $query->one($this->db);

        if(!empty($role))
            $role = $this->populateItem($role);

        return $role;
    }