Get an item from the internal data array

This is a short cut function to ensure that we test that the item
exists in the data array before we try to retrieve it.

@param $itemname
@return mixed|null
326284
public function getDataItem($itemname)
    {
        if (isset($this->data[$itemname])) {
            return $this->data[$itemname];
        }

        return null;
    }
469600
public function get_item_value($item) {
        if ($this->structure instanceof mod_feedback_completion) {
            return $this->structure->get_item_value($item);
        }
        return null;
    }
918948
public function getItem($id)
    {
        foreach ($this->items as $item) {
            if ($item->getId() == $id) {
                return ($item);
            }
        }

        return null;
    }
733553
public function getItem($key, $itemId)
    {
        $dataset = $this->getDataset($key);

        foreach ($dataset as $item) {
            if ($item["id"] === $itemId) {
                return $item;
            }
        }
        return null;
    }
966292
public function get_old_parentid($itemname) {
        return array_key_exists($itemname, $this->elementsoldid) ? $this->elementsoldid[$itemname] : null;
    }
139968
public function getItem( $index )
    {
        $item = null;

        if ( isset( $this->attributes['items'][$index] ) )
            $item = $this->attributes['items'][$index];

        return $item;
    }
22011
public function item($key)
	{
		if ( ! isset($this->info['items'][$key]))
		{
			return null;
		}

		return $this->info['items'][$key];
	}
962964
public function get_new_parentid($itemname) {
        return array_key_exists($itemname, $this->elementsnewid) ? $this->elementsnewid[$itemname] : null;
    }
1005591
public function getItemByMPN($mpn)
    {
        $item = current(array_filter($this->items, function (Item $item) use ($mpn) {
            return ($item->mpn === $mpn);
        }));

        return ($item) ? $item : null;
    }
858931
public function get($sectionName, $itemName, $defaultValue = null)
    {
        $section = $this->getSection($sectionName);

        return $section->get($itemName, $defaultValue);
    }
795203
public function getIndex($indexName)
    {
    	if (array_key_exists($indexName, $this->indices)) {
	    	return $this->indices[$indexName];
    	}

    	return null;
    }
495355
public function get_item($itemid) {
        global $DB;

        $item = $DB->get_record('tool_recyclebin_category', array(
            'id' => $itemid
        ), '*', MUST_EXIST);

        $item->name = get_course_display_name_for_list($item);

        return $item;
    }
842118
public static function GetItemInfo($itemname, $itemchunks)
  {
    $retval = "-";
    for ($i=0;$i<count($itemchunks);$i++)
    if (strcasecmp($itemchunks[$i], $itemname) == 0) $retval = $itemchunks[$i+1];
    return  $retval;
  }
432632
protected function findOrCreateItem(array $item)
    {
        $entity = null;
        // If the table was not truncated to begin with, find current entity
        // first
        if (false === $this->truncate) {
            if (!empty($this->lookupFields)) {
                $lookupConditions = array();
                foreach ($this->lookupFields as $fieldName) {
                    $lookupConditions[$fieldName] = $item[$fieldName];
                }
                $entity = $this->entityRepository->findOneBy(
                    $lookupConditions
                );
            } else {
                $entity = $this->entityRepository->find(current($item));
            }
        }

        if (!$entity) {
            return $this->getNewInstance();
        }

        return $entity;
    }
913127
public function hasChild($itemName, $childName)
    {
        $children = $this->getChildren($itemName);
        if (in_array($childName, $children)) {
            return true;
        }
        return false;
    }
417425
protected function itemAt($key)
    {
        if (isset($this->_data[$key])) {
            return $this->_data[$key];
        }
        return null;
    }
564552
public function get($key)
    {
        $k = $this->hash($key);
        if (!isset($this->cache[$k])) {
            return null;
        }
        $item = $this->cache[$k];
        if (isset($item->expire)) {
            if (microtime(true) >= $item->expire) {
                unset($this->cache[$k]);
                return null;
            }
        }
        return $item;
    }