Create a KeySet from an array created by {@see Google\Cloud\Spanner\KeySet::keySetObject()}.

@param array $keySet An array of KeySet data.
@return KeySet
@access private
969622
public static function fromArray(array $keySet)
    {
        $res = new self();
        if (isset($keySet['all'])) {
            $res->setMatchAll($keySet['all']);
        }

        if (isset($keySet['keys'])) {
            $res->setKeys($keySet['keys']);
        }

        if (isset($keySet['ranges'])) {
            foreach ($keySet['ranges'] as $range) {
                $res->addRange(KeyRange::fromArray($range));
            }
        }

        return $res;
    }
900105
public function insert(array $set)
    {
        if (empty($set)) {
            return null;
        }
        if ($this->accum !== null) {
            $this->accum[] = $set;
            if (count($this->accum) >= $this->sizeAccum) {
                $this->multiInsert($this->accum, true);
                $this->accum = array();
            }
            $this->lastIdAccum++;
            return $this->lastIdAccum;
        }
        if ($this->map) {
            $set = $this->map->set($set);
        }
        if ($this->fake) {
            return $this->fake->insert($set);
        }
        $pattern = 'INSERT INTO ?t (?cols) VALUES (?ln)';
        $data = array($this->name, array_keys($set), array_values($set));
        return $this->db->query($pattern, $data)->id();
    }
939705
public static function fromProperties(array $properties)
    {
        $copy = new self();
        foreach (self::getPropertyNames() as $name) {
            if (isset($properties[$name])) {
                $copy->{'set'.ucfirst($name)}($properties[$name]);
            }
        }

        return $copy;
    }
1051528
public function deleteMutation($table, KeySet $keySet)
    {
        return [
            self::OP_DELETE => [
                'table' => $table,
                'keySet' => $this->flattenKeySet($keySet),
            ]
        ];
    }
652635
public function fromArray(array $params)
    {
        foreach($params as $key => $value){
            $method = 'set' . ucfirst($key);
            if(method_exists($this, $method)){
                $this->$method($value);
            }
        }
        $this->normalize();
        return $this;
    }
1147987
public static function fromArray(array $attributes) {
		unset($attributes['id']);
		
		$attributesObject = new self();
		
		foreach ($attributes as $key => $value) {
			$attributesObject->add($key, $value);
		}
		
		return $attributesObject;
	}
1286217
public static function expand(array $set) {
        $data = array();

        foreach ($set as $key => $value) {
            $data = static::insert($data, $key, $value);
        }

        return $data;
    }
837646
public function fromArray($data)
    {
        foreach ($data as $key => $value) {
            if (is_int($key) || $this->isFillable($key)) {
                $this->set($key, $value);
            }
        }
        return $this;
    }
965356
public function open( $set = null )
    {
        return $this->setting(
            'open',
            null === $set ? null : (bool) $set
        );
    }
320613
public function lazySet(array $sets)
    {
        $config = $this->config();

        if (!array_key_exists('lazy-set', $config) || !is_array($config['lazy-set'])) {
            throw new \Exception('Config with key "lazy-set" does not exist or incorrect data type given in '.__NAMESPACE__);
        }
        $lazySetConfig = $config['lazy-set'];
        foreach ($sets as $set) {
            if (!array_key_exists($set, $lazySetConfig)) {
                throw new \Exception('"lazy-set" with name "'.$set.'" does not exist in '.__NAMESPACE__);
            }
        }
        $lazySets = array();
        foreach ($sets as $setIdentifier) {
            $lazySet = $lazySetConfig[$setIdentifier];
            foreach ($lazySet as $type => $set) {
                if (!is_array($set)) {
                    $lazySet[$type] = $set;
                    continue;
                }
                foreach ($set as $index => $attribute) {
                    $deepArray = !in_array($type, $this->deepArrayFalse);
                    $value = $this->configParser($type, $attribute);
                    if (empty($value)) {
                        $value = array();
                    }
                    if ($deepArray) {
                        $lazySet[$type][$index] = $value;
                    } else {
                        $lazySet[$type] = $value;
                    }
                }
            }
            $lazySets = array_merge_recursive($lazySet, $lazySets);
        }
        return $lazySets;
    }
852099
public synchronized Set<String> keySet() {
		if(size == 0) {
			return new HashSet<String>(0);
		} else {
			try {
				XAttributeMap map = deserialize();
				return map.keySet();
			} catch (IOException e) {
				e.printStackTrace();
				return null;
			}
		}
	}
1040187
public function fromArray($array) {
		$array=parent::fromArray($array);
		foreach ( $array as $key => $value ) {
			$this->setProperty($key, $value);
		}
		return $array;
	}
70659
public function addFieldset(Fieldset $fieldset)
    {
        $this->fieldsets[] = $fieldset;
        $this->current     = count($this->fieldsets) - 1;
        return $this;
    }
1018379
public function getSet($set)
    {
        if (isset($this->sets[$set])) {
            return $this->sets[$set];
        }
        return null;
    }
736276
public function diff(Set $set): Set
    {
        return $this->table->diff($set->table)->keys();
    }
116348
public function replace(array $set)
    {
        if (empty($set)) {
            return null;
        }
        if ($this->map) {
            $set = $this->map->set($set);
        }
        if ($this->fake) {
            return $this->fake->replace($set);
        }
        $pattern = 'REPLACE INTO ?t (?cols) VALUES (?ln)';
        $data = array($this->name, array_keys($set), array_values($set));
        return $this->db->query($pattern, $data)->id();
    }
1086171
protected function _setKeys($keys)
    {
        if (!is_array($keys)) {
            throw new Exception\InvalidArgumentException('Invalid options argument provided to filter');
        }

        foreach ($keys as $type => $key) {
            if (is_file($key) and is_readable($key)) {
                $file = fopen($key, 'r');
                $cert = fread($file, 8192);
                fclose($file);
            } else {
                $cert = $key;
                $key  = count($this->keys[$type]);
            }

            switch ($type) {
                case 'public':
                    $test = openssl_pkey_get_public($cert);
                    if ($test === false) {
                        throw new Exception\InvalidArgumentException("Public key '{$cert}' not valid");
                    }

                    openssl_free_key($test);
                    $this->keys['public'][$key] = $cert;
                    break;
                case 'private':
                    $test = openssl_pkey_get_private($cert, $this->passphrase);
                    if ($test === false) {
                        throw new Exception\InvalidArgumentException("Private key '{$cert}' not valid");
                    }

                    openssl_free_key($test);
                    $this->keys['private'][$key] = $cert;
                    break;
                case 'envelope':
                    $this->keys['envelope'][$key] = $cert;
                    break;
                default:
                    break;
            }
        }

        return $this;
    }