public function save($id, $values)
    {
        // We need to verify nonce value, before
        // we save model data to the Singularity.
        $this->nonce->verify($this->getSlug());

        // If model is preserved as single, update
        // single row with model slug as meta key.
        if ($this->isPreservedAs('single')) {
            return $this->updateMeta($id, [
                'key' => $this->getSlug(),
                'value' => $values,
            ]);
        }

        // If model is preserved as multiple, update
        // multiple rows where meta key is value key.
        if ($this->isPreservedAs('multiple')) {
            foreach ($values as $key => $value) {
                $this->updateMeta($id, [
                    'key' => $key,
                    'value' => $value,
                ]);
            }
        }
    }
public function save($id, $values)
    {
        // We need to verify nonce value, before
        // we save model data to the Singularity.
        $this->nonce->verify($this->getSlug());

        // If model is preserved as single, update
        // single row with model slug as meta key.
        if ($this->isPreservedAs('single')) {
            return $this->updateMeta($id, [
                'key' => $this->getSlug(),
                'value' => $values,
            ]);
        }

        // If model is preserved as multiple, update
        // multiple rows where meta key is value key.
        if ($this->isPreservedAs('multiple')) {
            foreach ($values as $key => $value) {
                $this->updateMeta($id, [
                    'key' => $key,
                    'value' => $value,
                ]);
            }
        }
    }
public function save ( $ id , $ values ) { // We need to verify nonce value, before // we save model data to the Singularity. $ this -> nonce -> verify ( $ this -> getSlug ( ) ) ; // If model is preserved as single, update // single row with model slug as meta key. if ( $ this -> isPreservedAs ( 'single' ) ) { return $ this -> updateMeta ( $ id , [ 'key' => $ this -> getSlug ( ) , 'value' => $ values , ] ) ; } // If model is preserved as multiple, update // multiple rows where meta key is value key. if ( $ this -> isPreservedAs ( 'multiple' ) ) { foreach ( $ values as $ key => $ value ) { $ this -> updateMeta ( $ id , [ 'key' => $ key , 'value' => $ value , ] ) ; } } }
Save model.

@param int $id
@param mixed $values

@return void
Save model .