/** * updates one property without saving structure. */ private function update($userId, $webspaceKey, $locale, $property, $data, StructureInterface $content, $render = true) { $sequence = $this->setValue($content, $property, $data, $webspaceKey, $locale); if (false !== $sequence) { // length of property path is important to render $property = implode(',', array_slice($sequence['sequence'], 0, -1 * sizeof($sequence['propertyPath']))); } if ($render === true) { $changes = $this->renderStructure($content, true, $property); if ($changes !== false) { $this->previewCache->appendChanges([$property => $changes], $userId, $content->getUuid(), $webspaceKey, $locale); } } return $content; }
/** * Generate changes and save them in the cache. */ private function generateChanges($userId, $webspaceKey, $locale, $property, StructureInterface $content) { $sequence = $this->crawler->getSequence($content, $property); if (false !== $sequence) { // length of property path is important to render $property = implode(',', array_slice($sequence['sequence'], 0, -1 * count($sequence['propertyPath']))); } try { $changes = $this->renderStructure($content, true, $property); } catch (\Twig_Error $ex) { throw new TwigPreviewException($ex); } if ($changes !== false) { $this->previewCache->appendChanges([$property => $changes], $userId, $content->getUuid(), $webspaceKey, $locale); } }