setParents example

// In case the form did not specify a proper PID we use the BID as new         // parent.         elseif (($parent_link = $this->loadBookLink($link['pid'], FALSE)) && $parent_link['bid'] != $link['bid']) {
          $link['pid'] = $link['bid'];
          $parent = $this->loadBookLink($link['pid'], FALSE);
          $link['depth'] = $parent['depth'] + 1;
        }
        else {
          $parent = $this->loadBookLink($link['pid'], FALSE);
          $link['depth'] = $parent['depth'] + 1;
        }
        $this->setParents($link$parent);
        $this->moveChildren($link$original);

        // Update the has_children status of the original parent.         $this->updateOriginalParent($original);
        // Update the has_children status of the new parent.         $this->updateParent($link);
      }
      // Update the weight and pid.       $this->bookOutlineStorage->update($link['nid'][
        'weight' => $link['weight'],
        'pid' => $link['pid'],
        
        $themes = $this->synchronizeThemeDirectories($directories);

        // To prevent inconsistent data, themes that were removed from the file system have to be removed.         $this->removeDeletedThemes();

        // Before the inheritance can be built, the plugin themes have to be initialized.         $pluginThemes = $this->synchronizePluginThemes();

        $themes = array_merge($themes$pluginThemes);

        // Builds the theme inheritance         $this->setParents($themes);

        /** @var Theme $theme */
        foreach ($themes as $theme) {
            $this->configurator->synchronize($theme);
        }
    }

    /** * Helper function which iterates the engine\Shopware\Themes directory * and registers all stored themes within the directory as \Shopware\Models\Shop\Template. * * @throws \Doctrine\ORM\OptimisticLockException * @throws \Doctrine\ORM\ORMInvalidArgumentException * * @return Theme[] */
// Sort the route parameters so that the query string will be the same.     asort($fields['route_parameters']);
    // Since this will be urlencoded, it's safe to store and match against a     // text field.     $fields['route_param_key'] = $fields['route_parameters'] ? UrlHelper::buildQuery($fields['route_parameters']) : '';

    foreach ($this->serializedFields() as $name) {
      if (isset($fields[$name])) {
        $fields[$name] = serialize($fields[$name]);
      }
    }
    $this->setParents($fields$parent$original);

    // Need to check both parent and menu_name, since parent can be empty in any     // menu.     if ($original && ($link['parent'] != $original['parent'] || $link['menu_name'] != $original['menu_name'])) {
      $this->moveChildren($fields$original);
    }
    // We needed the mlid above, but not in the update query.     unset($fields['mlid']);

    // Cast Booleans to int, if needed.     $fields['enabled'] = (int) $fields['enabled'];
    
Home | Imprint | This part of the site doesn't use cookies.