Nextras: Access object properties to get a item value
@param  Nextras\Orm\Entity\Entity $item
@param  string                    $key
@return mixed
334375
public function getNextrasEntityProperty(Nextras\Orm\Entity\Entity $item, $key)
	{
		$properties = explode('.', $key);
		$value = $item;

		while ($property = array_shift($properties)) {
			if (!isset($value->{$property})) {
				if ($this->datagrid->strict_entity_property) {
					throw new DataGridException(sprintf(
						'Target Property [%s] is not an object or is empty, trying to get [%s]',
						$value, str_replace('.', '->', $key)
					));
				}

				return null;
			}

			$value = $value->{$property};
		}

		return $value;
	}
274782
public function get($item)
    {
        $data = $this->getData();

        return empty($data->$item) ? null : $data->$item;
    }
293391
private function find_item_key( $item, $field ) {
		foreach ( array( $field, $this->prefix . '_' . $field ) as $maybe_key ) {
			if ( ( is_object( $item ) && ( property_exists( $item, $maybe_key ) || isset( $item->$maybe_key ) ) ) || ( is_array( $item ) && array_key_exists( $maybe_key, $item ) ) ) {
				$key = $maybe_key;
				break;
			}
		}

		if ( ! isset( $key ) ) {
			\WP_CLI::error( "Invalid field: $field." );
		}

		return $key;
	}
1243887
public function addItem($key, $item)
    {
        $dataset = $this->getDataset($key);

        // Get max value for the id
        $max = 0;
        foreach ($dataset as $val) {
            if ($max < $val["id"]) {
                $max = $val["id"];
            }
        }
        $item["id"] = $max + 1;
        $dataset[] = $item;
        $this->saveDataset($key, $dataset);
        return $item;
    }
920299
public function setItem($key, $item) {
		if (is_array($key)) {
			$key = $this->arrayHashFunction($key);
		}
		
		if (! isset($this->_data[$key])) {
			$this->_map[] = $key;
		}
		
		if (is_object($item)) {
			$modelClass = $this->getModel();
			if (! $item instanceof $modelClass) {
				throw new Exception('Model must be an instance of "' . $modelClass . '"');
			}
			
			$item->setCollection($this);
			
			$this->_data[$key]   = &$item->getDataLinked();
			$this->_models[$key] = $item;
		}
		elseif (is_array($item)) {
			$this->_data[$key] = $item;
		}
		else {
			throw new Exception('Unknown type of item: "' . gettype($item) . '"');
		}
		
		return $this;
	}
581750
public function get($key)
	{
		$item = new Item($key);

		if (isset(self::$store[$key]))
		{
			$item->setValue(self::$store[$key]);
		}

		return $item;
	}
606932
private function findItem($item, $arr, $key) {
        for($j = 0; $j < count($arr); $j++) {
            if($arr[$j]->$key == $item->$key) {
                return $j;
            }
        }
        return false;
    }
375519
private function getValue($item, $model)
    {
        if (is_string($item)) {
            if ($model instanceof Model) {
                if (isset($model->{$item})) {
                    return $model->{$item};
                }
                return $item;
            } else {
                if (isset($model[$item])) {
                    return $model[$item];
                }
                return $item;
            }
        } else if (is_callable($item)) {
            return call_user_func($item, $model);
        }
        return '';
    }
579790
public function offsetGet($key)
    {
        if (isset($this->firstItems[$key])) {
            return $this->firstItems[$key];
        }

        if (isset($this->lastItems[$key])) {
            return $this->lastItems[$key];
        }

        $record = $this->list->find($this->keyField, $key);

        if ($record) {
            $col = $this->valueField;

            return $record->$col;
        }

        return null;
    }
268107
public function getValue($key)
	{
		if ($this->item instanceof LeanMapper\Entity) {
			return $this->getLeanMapperEntityProperty($this->item, $key);

		} elseif ($this->item instanceof Nextras\Orm\Entity\Entity) {
			return $this->getNextrasEntityProperty($this->item, $key);

		} elseif ($this->item instanceof DibiRow) {
			return $this->item->{$this->formatDibiRowKey($key)};

		} elseif ($this->item instanceof ActiveRow) {
			return $this->getActiveRowProperty($this->item, $key);

		} elseif ($this->item instanceof Nette\Database\Row) {
			return $this->item->{$key};

		} elseif (is_array($this->item)) {
			$arrayValue = $this->item[$key];

			if (is_object($arrayValue) && method_exists($arrayValue, '__toString')) {
				return $arrayValue->__toString();
			}

			return $arrayValue;

		} else {
			/**
			 * Doctrine entity
			 */
			return $this->getDoctrineEntityProperty($this->item, $key);
		}
	}
455276
public function put(Item $item, Context\Put $context = null)
    {
        $table = $item->getTable();

        if (null !== $this->logger) {
            $this->log('Put on table '.$table);
        }

        if (empty($table)) {
            throw new \Riverline\DynamoDB\Exception\AttributesException('Item do not have table defined');
        }

        $attributes = array();
        foreach ($item as $name => $attribute) {
            /** @var $attribute \Riverline\DynamoDB\Attribute */
            if ("" !== $attribute->getValue()) {
                // Only not empty string
                $attributes[$name] = $attribute->getForDynamoDB();
            }
        }
        $parameters = array(
            'TableName' => $table,
            'Item'      => $attributes,
        );

        if (null !== $context) {
            $parameters += $context->getForDynamoDB();
        }

        if (null !== $this->logger) {
            $this->log('Put request paramaters : '.print_r($parameters, true), Logger::DEBUG);
        }

        $response = $this->connector->putItem($parameters);

        if (null !== $this->logger) {
            $this->log('Put request response : '.print_r($response, true), Logger::DEBUG);
        }

        // Update write counter
        $this->addConsumedWriteUnits($table, floatval($response['ConsumedCapacityUnits']));

        return $this->populateAttributes($response);
    }
459786
public function mapItem(PersistenceItem $item): Item
    {
        try {
            $itemDefinition = $this->itemDefinitionRegistry->getItemDefinition($item->valueType);
        } catch (ItemDefinitionException $e) {
            $itemDefinition = new NullItemDefinition($item->valueType);
        }

        $itemData = [
            'id' => $item->id,
            'status' => $item->status,
            'definition' => $itemDefinition,
            'collectionId' => $item->collectionId,
            'position' => $item->position,
            'value' => $item->value,
            'configs' => iterator_to_array(
                $this->configMapper->mapConfig(
                    $item->config,
                    $itemDefinition->getConfigDefinitions()
                )
            ),
            'cmsItem' => function () use ($item, $itemDefinition): CmsItemInterface {
                $valueType = $itemDefinition instanceof NullItemDefinition ? 'null' : $itemDefinition->getValueType();

                return $this->cmsItemLoader->load($item->value, $valueType);
            },
        ];

        return Item::fromArray($itemData);
    }
606411
protected function loadAssociationObjectsToEntity(array $item, $entity)
    {
        foreach ($this->entityMetadata->getAssociationMappings() as $associationMapping) {

            $value = null;
            if (isset($item[$associationMapping['fieldName']]) && !is_object($item[$associationMapping['fieldName']])) {
                $value = $this->entityManager->getReference($associationMapping['targetEntity'], $item[$associationMapping['fieldName']]);
            }

            if (null === $value) {
                continue;
            }

            $setter = 'set' . ucfirst($associationMapping['fieldName']);
            $this->setValue($entity, $value, $setter);
        }
    }
43032
protected function getValues($item, array $keys)
    {
        $values = [];
        foreach ($keys as $key) {
            $values[] = Vale::get($item, $key);
        }

        return $values;
    }
160455
public function get($key, $default = null)
    {
        if (! $this->has($key)) {
            return $default;
        }

        if (! $this->isNestedKey($key)) {
            return $this->items[$key];
        }

        return $this->getNestedValueByKey($key);
    }
140893
protected function htmlEntityEncode($item)
    {
        if (is_array($item)) {
            array_walk_recursive($item, function (&$value) {
                $value = htmlentities($value);
            });
        } else {
            $item = htmlentities($item);
        }

        return $item;
    }
469600
public function get_item_value($item) {
        if ($this->structure instanceof mod_feedback_completion) {
            return $this->structure->get_item_value($item);
        }
        return null;
    }