@param int   $key
@param array $properties

@return mixed
184349
private static function readProperty(int $key, array $properties)
    {
        assert(array_key_exists($key, $properties));

        return $properties[$key];
    }
267830
function getFromKeys(array $keys)
    {
        $realm = $this->getRealm();


        foreach ($keys as $i => $k)
            $keys[$i] = "'$k'";

        $keys = implode(', ', $keys);

        try {
            $sql = "SELECT * FROM `KVStore` WHERE `realm` = '$realm' and `key` IN ($keys);";

            $stm = $this->pdo->prepare($sql);
            $stm->execute();
            $stm->setFetchMode(\PDO::FETCH_ASSOC);

            $c = $stm->fetchAll();

            foreach ($c as $d) {
                $key     = $d['key'];
                $val     = $this->getDataInterchange()->retrieveBackward( $d['value'] );

                parent::set($key, $val);
                yield $key => $val;
            }

        } catch (\Exception $e) {
            throw new exReadError($e->getMessage(), $e->getCode(), $e);
        }
    }
793724
public function llen($key) {

        $value = $this->get($key, array());

        return is_array($value) ? count($value):0;
    }
26338
public Property get(String key) {
        for (Property property : properties) {
            if (property.getKey().equals(key)) {
                return property;
            }
        }
        return null;
    }
813010
function &get($key) {
		if ($key=='_id')
			return $this->_id;
		elseif (array_key_exists($key,$this->fields))
			return $this->fields[$key]['value'];
		elseif (array_key_exists($key,$this->adhoc))
			return $this->adhoc[$key]['value'];
		elseif (array_key_exists($key,$this->props))
			return $this->props[$key];
		user_error(sprintf(self::E_Field,$key),E_USER_ERROR);
	}
444882
public function addContext($key, $properties)
    {
        if (isset($this->context[$key]) && is_array($this->context[$key])) {
            $this->context[$key] = array_merge($this->context[$key], $properties);
        } else {
            $this->context[$key] = $properties;
        }
    }
243573
public function getArray($key)
    {
        try {
            $result = $this->get(self::DATA_ARRAY, $key);
            if (!settype($result, 'array')) {
                return null;
            }
        } catch (\Exception $e) {
            return null;
        }
        return $result;
    }
810919
public function offsetGet($key)
    {
        if (! isset($this->data[$key]) or is_array($this->data[$key])) {
            return $this->getSubset($key);
        }
        return $this->data[$key];
    }
100092
public function containsKey($key)
    {
        if (strpos($key, ".") !== false) {
            //we have a dot, we need to split the ket by the dot and check
            //individual string if they are part of the nestes array
            $keys = explode('.', $key);
            $keysCount = count($keys);
            
            
            $tmpArray = $this->properties;
            foreach ($keys as $index=>$subKey) {
             
                
                if (empty($tmpArray) || empty($subKey))
                {
                    return false;
                } 
                else if ($index+1 < $keysCount)
                {
                    //arizzini: if the current $index is not the last $subKey
                    //we want to check is the $tmpArray is an array
                    $tmpArray = $this->getArrayObject($tmpArray, $subKey);
                }
                else {
//                  echo "checking if subkey=$subKey exists";
//                  print_r($tmpArray);
                    //
                    return $this->getArrayObject($tmpArray, $subKey) !== null;
                    //return array_key_exists($subKey, $tmpArray);
                    
                }
            }
        } else {
            return $this->getArrayObject($this->properties, $key) !== null;
            
        }
        
    }
1029670
protected function setupOne(array $properties) {
        $pkName = $this->pkName;
        /** @var Column $column */
        foreach ($this->tableSchema->columns as $column) {
            if (!array_key_exists($column->name, $properties)) {
                continue;
            }

            if (null !== $properties[$column->name]) {
                if ($column->isInt()) {
                    $this->_properties[$column->name] =
                        (int) $properties[$column->name];
                } else if ($column->isFloat()) {
                    $this->_properties[$column->name] =
                        (float) $properties[$column->name];
                } else {
                    $this->_properties[$column->name] =
                        $properties[$column->name];
                }
            } else {
                $this->_properties[$column->name] = null;
            }
        }
        $this->_modified = array();
        $this->_oldPK = $this->_properties[$pkName] ?? null;
        return $this;
    }
600585
public function properties (array $properties = array())
    {
        $res = '';
        
        if (!empty($properties)) {
            foreach ($properties as $key => $property) {
                $res .= ' ' . $key . '="' . $property . '"';
            }
        }

        return $res;
    }
804799
protected function getNestedRelations($key, $relations)
	{
		if(is_numeric($relations))
		{
			if($key == 'fields')
			{
				return $relations;
			}
			if($relations - 1 > 0)
			{
				return $relations - 1;
			}
			return [];
		}

		$nestedRelations = [];
		foreach ($relations as $prop)
		{
			if($prop === 'assets') {
				$nestedRelations[] = $prop;
				continue;
			}
			if(0 === strpos($prop, $key.'.'))
			{
				$newRelation = substr($prop, strlen($key) + 1);
				if( strlen($newRelation) !== 0)
				{
					$nestedRelations[] = $newRelation;
				}
			}
		}
		$nestedRelations = array_unique($nestedRelations);
		return $nestedRelations;
	}
561465
private function getByPropertyName($key)
    {
        if (($key = $this->getArrayKey($key)) !== static::NOT_FOUND) {
            if (is_array($this->items[$key])) {
                return $this->__wrap($this->items[$key]);
            }

            return $this->items[$key];
        }

        return static::NOT_FOUND;
    }
177934
public function hdel($key) {

        $set = $this->get($key, array());

        if(!count($set)) return 0;

        $fields  = func_get_args();
        $removed = 0;

        for ($i=1; $i<count($fields); $i++){

            $field = $fields[$i];

            if(isset($set[$field])){
                unset($set[$field]);
                $removed++;
            }
        }

        $this->set($key, $set);

        return $removed;
    }
652370
public function getInt($key)
    {
        try {
            $result = $this->get(self::INT, $key);
            if (!settype($result, 'integer')) {
                return 0;
            }
        } catch (\Exception $e) {
            return 0;
        }
        return $result;
    }
76424
public function __isset($key)
    {
        $is_set = false;

        if (!in_array($key, $this->deprecated_properties)) {
            $is_set =
                method_exists($this, $this->getLoaderMethod($key)) ||
                ($this->hasInternalValue($key) &&
                    $this->internal_property_accessible[$key]) ||
                array_key_exists($key, $this->getProtectedPropertyList());
        }

        return $is_set;
    }
460983
public static function get(array $properties)
    {
        if (!array_key_exists('columns', $properties)) {
            throw new Exception('An index requires at least one column.');
        }

        $index = new Index();

        foreach ((array) $properties['columns'] as $column) {
            $index->addColumn($column);
        }

        if (array_key_exists('name', $properties) && !empty($properties['name'])) {
            $index->setName($properties['name']);
        }

        if (array_key_exists('type', $properties) && !empty($properties['type'])) {
            $index->setType($properties['type']);
        }

        return $index;
    }