Remove attributes from an existing item

@param array ...$attributes
@return bool
@throws InvalidQuery
180597
public function removeAttribute(...$attributes)
    {
        $keySet = !empty(array_filter($this->model->getKeys()));

        if (!$keySet) {
            $analyzer = $this->getConditionAnalyzer();

            if (!$analyzer->isExactSearch()) {
                throw new InvalidQuery('Need to provide the key in your query');
            }

            $id = $analyzer->identifierConditionValues();
            $this->model->setId($id);
        }

        $key = DynamoDb::marshalItem($this->model->getKeys());

        $this->resetExpressions();

        /** @var \Aws\Result $result */
        $result = DynamoDb::table($this->model->getTable())
            ->setKey($key)
            ->setUpdateExpression($this->updateExpression->remove($attributes))
            ->setExpressionAttributeNames($this->expressionAttributeNames->all())
            ->setReturnValues('ALL_NEW')
            ->prepare($this->client)
            ->updateItem();

        $success = array_get($result, '@metadata.statusCode') === 200;

        if ($success) {
            $this->model->setRawAttributes(DynamoDb::unmarshalItem($result->get('Attributes')));
            $this->model->syncOriginal();
        }

        return $success;
    }
173968
public function removeAttribute($attribute)
    {
        if (in_array(strtolower($attribute), $this->watchedAttributes)) {
            $this->onAttributeChange(strtolower($attribute), null);
        } else {
            self::removeAttributeArray($this->attributes, $attribute);
        }
        return $this;
    }
394908
public static function fromArray(array $attributes) {
        $object = new ArrayObject();
        foreach ($attributes as $key => $val) {
            $object[$key] = $val;
        }
        return $object;
    }
559584
public function replaceHashableAttributes($attributes)
    {
        $hash_id = $this->generateHashId($attributes);
        if($hash_id) {
            $attributes['hash_id'] = $hash_id;
            foreach ($this->hashableAttributes as $value) {
                unset($attributes[$value]);
            }
        }
        return $attributes;
    }
1032137
public function create(array $attributes)
    {
        /*
         * Check if is single associate array item.
         */
        if (array_is_assoc(head($attributes))) {
            throw new InvalidArgumentException('Trying to pass multiple items in create() method. Please use createMany() instead.');
        }

        // Unset primary key when $updateWhenIdExists is true, to make sure to create new record in database.
        if (array_is_assoc($attributes) && $this->updateWhenIdExists && array_key_exists($pk = $this->model->getKeyName(), $attributes)) {
            unset($attributes[$pk]);
        }

        $this->validation()->validate('create', $attributes);

        $model = $this->model->newInstance($attributes);

        $this->beforeSaveModel($model);

        $model->save();

        return $model;
    }
218569
private function prepareAttributes($attributes = array())
    {
        if (!is_array($attributes)) {
            throw new InvalidArgumentException("[ImBundle] format attributes must be an array, recieved: " . var_export($attributes, true));
        }
        $result = "";
        foreach ($attributes as $key => $value) {
            if ($key === null || $key === "") {
                $result .= " " . $value;
            } else {
                $result .= " -" . $key;
                if ($value != "") {
                    $result .= " \"" . $value . "\"";
                }
            }
        }

        return $result;
    }
779555
public function setAttributes(array $attributes = null)
    {
        ValidationUtility::ensureNullOrArrayOfType(
            '$attributes', $attributes, __NAMESPACE__ . '\Pair');

        $this->attributes = $attributes;

        return $this;
    }
339819
public function setTableAttributes(array $attributes)
    {
        foreach ($attributes as $attribute => $value) {
            $this->tableAttributes[$attribute] = $value;
        }

        return $this;
    }
225426
public function replace(array $attributes):bool
    {
        $status = false;
        foreach ($this->session as $one => $value) {
            if (null !== $this->get($one)) {
                $this->set($one, $value);
                $status = true;
            }
        }
        if (true === $status) {
            $this->save();
        }

        return ($status);
    }
359708
public function _setAttributes($attributes)
    {
        if (is_array($attributes)) {
            foreach ($attributes as $attribute => $value) {
                $this->{$attribute} = $value;
            }

            return $this;
        }

        //@todo: put real exception here cos exception' gon be thrown either ways, so put one that makes sense
        //or something else that has more meaning
        throw new \InvalidArgumentException('Invalid argument Passed to set attributes on object');
    }
1175293
public function removeJugglable($attributes)
    {
        // Make sure we are dealing an associative array
        if ( ! is_array($attributes)) {
            $attributes = func_get_args();
        }
        $attributes = array_flip($attributes);

        // Get the remaining jugglables
        $jugglables = array_diff_key($this->getJugglable(), $attributes);

        // Set the remaining jugglables
        $this->setJugglable($jugglables);
    }
538652
public function attributes(array $attributes)
        {
            $this->attributes = array_replace($this->attributes, $this->markup->attributes($this->tag, $attributes));

            return $this;
        }
666635
public function update(array $attributes)
    {
        return $this->validate($attributes) ? (boolean) Language::where('id', $attributes['id'])->update($attributes) : false;
    }
123082
private function supportsAnyAttribute($attributes)
    {
        foreach ($attributes as $attribute) {
            if ($this->supportsAttribute($attribute)) {
                return true;
            }
        }

        return false;
    }
749250
public function setLinkAttributes($attributes)
    {
        if (! is_array($attributes)) {
            $attributes = [$attributes];
        }

        $this->link_attributes = $attributes;

        return $this;
    }
1013608
public function update($attributes)
    {
        $this->attributes = array_merge($this->attributes, array_filter($attributes, function ($attribute) {
            return ! is_null($attribute);
        }));

        return $this;
    }
20688
public function map(array $attributes)
    {
        foreach ($attributes as $key => $value) {
            $this->{$key} = $value;
        }

        return $this;
    }