/** * Updates an EAV "value" object with the given value. * * @param \Cartalyst\Attributes\Value $valueInstance * @param mixed $value * @return \Cartalyst\Attributes\Value|bool */ protected function updateEavValue(Value $valueInstance, $value) { if (!$value) { $valueInstance->delete(); return; } $valueInstance->setValueKey($value); if ($valueInstance->save()) { return $valueInstance; } }