Sets the query operation to 'get' and optionally specifies the primary key.

@param mixed|null $hashValue
@param mixed|null $rangeValue

@return $this

@throws ODMException
546789
public function get($hashValue = null, $rangeValue = null)
    {
        if ($this->expr->condition->count() > 0) {
            throw ODMException::queryGetOperationConditionsNotSupported();
        }

        $this->setQueryClass(GetItem::class);

        if ($hashValue !== null) {
            $this->setPrimaryKey($hashValue, $rangeValue);
        }

        return $this;
    }
1155801
public function get($table, $hash, $range = null, Context\Get $context = null)
    {
        if (null !== $this->logger) {
            $this->log('Get on table '.$table);
        }

        // Primary key
        $hash = new Attribute($hash);

        $parameters = array(
            'TableName' => $table,
            'Key'       => array(
                'HashKeyElement' => $hash->getForDynamoDB()
            )
        );

        // Range key
        if (null !== $range) {
            $range = new Attribute($range);
            $parameters['Key']['RangeKeyElement'] = $range->getForDynamoDB();
        }

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

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

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

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

        $this->addConsumedReadUnits($table, floatval($response['ConsumedCapacityUnits']));

        if (isset($response['Item'])) {
            $item = new Item($table);
            $item->populateFromDynamoDB($response['Item']);
            return $item;
        } else {
            if (null !== $this->logger) {
                $this->log('Didn\'t find item');
            }
            return null;
        }
    }
1209280
public function applyHash(&$filterValue, $filterKey)
    {
        if ('grs_ssn' === $filterKey) {
            $filterValue = $this->project->getValueHash($filterValue, $this->hashAlgorithm);
        }
    }
113389
public function setQuery($spec, $value = null) {
        if ((null === $value) && ! is_array($spec)) {
            #require_once 'Zend/Controller/Exception.php';
            throw new Zend_Controller_Exception('Invalid value passed to setQuery(); must be either array of values or key/value pair');
        }
        if ((null === $value) && is_array($spec)) {
            foreach ($spec as $key => $value) {
                $this->setQuery($key, $value);
            }
            return $this;
        }
        $this->GET[(string) $spec] = $value;
        return $this;
    }
357415
public function generateFieldTypeHash($hashElementName, $hashValue)
    {
        $this->fieldTypeHashGenerator->generateHashValue(
            $this->json,
            $hashElementName,
            $hashValue
        );
    }
131649
public function prepare($bindings= array (), $byValue= true, $cacheFlag= null) {
        $this->stmt= null;
        if ($this->construct() && $this->stmt= $this->xpdo->prepare($this->sql)) {
            $this->bind($bindings, $byValue, $cacheFlag);
        } else {
            $this->xpdo->log(xPDO::LOG_LEVEL_ERROR, 'Could not construct or prepare query because it is invalid or could not connect: ' . $this->sql);
        }
        return $this->stmt;
    }
309437
protected function databaseValue($values)
    {
        if ($values instanceof SetValue) {
            $values = $values->toArray();
        } else {
            if (!is_array($values)) {
                throw ODMException::invalidValueForType('Set', ['array', 'SetValue', 'null'], $values);
            }
        }

        if (count($values) === 0) {
            throw ODMException::setsCannotBeEmpty();
        }

        return $values;
    }
1121869
public <H,R> T createKey(final H hashKey, final R rangeKey) {
        final T key = StandardBeanProperties.DeclaringReflect.<T>newInstance(targetType);
        if (hashKey != null) {
            final DynamoDBMapperFieldModel<T,H> hk = hashKey();
            hk.set(key, hashKey);
        }
        if (rangeKey != null) {
            final DynamoDBMapperFieldModel<T,R> rk = rangeKey();
            rk.set(key, rangeKey);
        }
        return key;
    }
340114
public T load(H hashKey, R rangeKey) {
        return mapper.<T>load(model.targetType(), hashKey, rangeKey);
    }
1155282
@Override
    public Object getValue(String paramName) throws IllegalArgumentException {
        if (!hasValue(paramName)) {
            throw new IllegalArgumentException("Can't find criteria with name " + paramName);
        }
        if (LIMIT_NAME.equals(paramName)) {
            return limit;
        }
        if (OFFSET_NAME.equals(paramName)) {
            return offset;
        }
        return criterias.get(paramName).getValue();
    }
1224473
public static function unknownDocument($hashValue, $rangevalue = null)
    {
        $error = sprintf("Unknown Document primary key '%s'", $hashValue);

        if ($rangevalue) {
            $error .= sprintf(":'%s'", $rangevalue);
        }

        return new self($error);
    }
136267
private function createQueryForColumn(ColumnConfiguration $column, $searchValue)
    {
        $searchType = $column->getSearch();

        if ($searchType == DefaultSearchable::NONE()) {
            // Don't do anything, this is not a searchable field
            return $this->query;
        } elseif ($searchType == DefaultSearchable::NORMAL()) {
            $this->query->orWhere($column->getName(), 'LIKE', '%' . $searchValue . '%');
        } elseif ($searchType == DefaultSearchable::REGEX()) {
            $this->query->orWhere($column->getName(), 'REGEXP', $searchValue);
        } else {
            throw new DatatableException('An unsupported DefaultSearchable was provided.');
        }

        return $this->query;
    }
631383
public static function findOneBy($collection, $fieldName, $searchValue, $default = null)
    {
        if (false === self::isValid($collection)) {
            return null;
        }

        $getter = sprintf('get%s', ucfirst($fieldName));
        foreach ($collection as $entity) {
            $function = [
                $entity,
                $getter
            ];

            if (false === is_callable($function)) {
                throw new LogicException('Missing getter');
            }

            if ($entity->$getter() === $searchValue) {
                return $entity;
            }
        }

        return $default;
    }
489742
public function fromPersistenceValue(PersistenceValue $fieldValue)
    {
        // Restored data comes in $data, since it has already been processed
        // there might be more data in the persistence value than needed here
        $result = $this->fromHash(
            array(
                'id' => (isset($fieldValue->externalData['id'])
                    ? $fieldValue->externalData['id']
                    : null),
                'fileName' => (isset($fieldValue->externalData['fileName'])
                    ? $fieldValue->externalData['fileName']
                    : null),
                'fileSize' => (isset($fieldValue->externalData['fileSize'])
                    ? $fieldValue->externalData['fileSize']
                    : null),
                'mimeType' => (isset($fieldValue->externalData['mimeType'])
                    ? $fieldValue->externalData['mimeType']
                    : null),
                'uri' => (isset($fieldValue->externalData['uri'])
                    ? $fieldValue->externalData['uri']
                    : null),
            )
        );

        return $result;
    }
70512
public function getQuery($name = null, $defaultValue = null, $notAllowEmpty = false)
    {
        if (!is_null($name)) {
            if (isset($this->getQueryParams()[$name])) {
                if (empty($this->getQueryParams()[$name]) && $notAllowEmpty) {
                    return $defaultValue;
                }

                return $this->getQueryParams()[$name];
            }

            return $defaultValue;
        }

        return $this->getQueryParams();
    }
436765
public static function keyValue($list, $keyProperty=null, $valueProperty=null)
    {
        $index = array();
        foreach ($list as $i) {
            if ($keyProperty) {
                if (!$valueProperty) { 
                    throw new \InvalidArgumentException("Must set value property if setting key property");
                }
                $index[$i->$keyProperty] = $i->$valueProperty;
            }
            else {
                $key = current($i);
                next($i);
                $value = current($i);
                $index[$key] = $value;
            }
        }
        return $index;
    }
795204
public function setDecimalValue($decimalValue)
    {
        if (\is_array($decimalValue) || \is_object($decimalValue)) {
            $m = "Invalid value type for attribute {$this->getFamilyCode()}.{$this->getAttributeCode()}, ";
            $m .= 'expecting float, got '.gettype($decimalValue);
            throw new \UnexpectedValueException($m);
        }
        $this->decimalValue = null === $decimalValue ? null : (float) $decimalValue;

        return $this;
    }