当前位置: 首页>>代码示例>>PHP>>正文


PHP ConfigEntityBase::save方法代码示例

本文整理汇总了PHP中Drupal\Core\Config\Entity\ConfigEntityBase::save方法的典型用法代码示例。如果您正苦于以下问题:PHP ConfigEntityBase::save方法的具体用法?PHP ConfigEntityBase::save怎么用?PHP ConfigEntityBase::save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Drupal\Core\Config\Entity\ConfigEntityBase的用法示例。


在下文中一共展示了ConfigEntityBase::save方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: save

 /**
  * {@inheritdoc}
  */
 public function save()
 {
     // Make sure we don't have any save exceptions before building menu
     // definitions.
     $return = parent::save();
     foreach ($this->getLinks([], TRUE) as $link_key => $link_def) {
         $this->getMenuLinkManager()->addDefinition($link_key, $link_def);
     }
     return $return;
 }
开发者ID:nerdstein,项目名称:taxonomy_menu,代码行数:13,代码来源:TaxonomyMenu.php

示例2: save

 /**
  * Overrides Drupal\Core\Entity\Entity::save().
  */
 public function save()
 {
     // Check if everything is valid.
     if (!$this->isValid()) {
         throw new InvalidBreakpointException('Invalid data detected.');
     }
     parent::save();
 }
开发者ID:anatalsceo,项目名称:en-classe,代码行数:11,代码来源:BreakpointGroup.php

示例3: save

 /**
  * {@inheritdoc}
  */
 public function save($create_creation_state = TRUE)
 {
     // Create the machine_name for new states.
     // N.B.: Keep machine_name in WorkflowState and ~ListBuilder aligned.
     $sid = $this->id();
     $wid = $this->wid;
     if (empty($sid) || $sid == WORKFLOW_CREATION_STATE_NAME) {
         if ($label = $this->label()) {
             // Format the machine_name. @todo Use a proper machine_name regex.
             $sid = str_replace(' ', '_', strtolower($label));
         } else {
             workflow_debug(__FILE__, __FUNCTION__, __LINE__);
             // @todo D8-port: still test this snippet.
             $sid = 'state_' . $this->id();
         }
         $this->set('id', implode('_', [$wid, $sid]));
     }
     return parent::save();
 }
开发者ID:sedurzu,项目名称:ildeposito8,代码行数:22,代码来源:WorkflowState.php

示例4: save

 /**
  * Given information, update or insert a new workflow.
  *
  * This also handles importing, rebuilding, reverting from Features,
  * as defined in workflow.features.inc.
  * TODO D8: clean up this function, since we are config entity now.
  * todo D7: reverting does not refresh States and transitions, since no
  * machine_name was present. As of 7.x-2.3, the machine_name exists in
  * Workflow and WorkflowConfigTransition, so rebuilding is possible.
  *
  * When changing this function, test with the following situations:
  * - maintain Workflow in Admin UI;
  * - clone Workflow in Admin UI;
  * - create/revert/rebuild Workflow with Features; @see workflow.features.inc
  * - save Workflow programmatic;
  *
  * @inheritdoc
  */
 public function save()
 {
     $status = parent::save();
     // Are we saving a new Workflow?
     // Make sure a Creation state exists.
     if ($status == SAVED_NEW) {
         $state = $this->getCreationState();
     }
     return $status;
 }
开发者ID:sedurzu,项目名称:ildeposito8,代码行数:28,代码来源:Workflow.php

示例5: save

 public function save()
 {
     $workflow = $this->getWorkflow();
     // To avoid double posting, check if this (new) transition already exist.
     if (empty($this->id())) {
         if ($workflow) {
             $config_transitions = $workflow->getTransitionsByStateId($this->from_sid, $this->to_sid);
             $config_transition = reset($config_transitions);
             if ($config_transition) {
                 $this->set('id', $config_transition->id());
             }
         }
     }
     // Create the machine_name. This can be used to rebuild/revert the Feature in a target system.
     if (empty($this->id())) {
         $wid = $workflow->id();
         $this->set('id', implode('', [$wid, substr($this->from_sid, strlen($wid)), substr($this->to_sid, strlen($wid))]));
     }
     $status = parent::save();
     if ($status) {
         // Save in current workflow for the remainder of this page request.
         // Keep in sync with Workflow::getTransitions() !
         if ($workflow) {
             $workflow->transitions[$this->id()] = $this;
             // $workflow->sortTransitions();
         }
     }
     return $status;
 }
开发者ID:sedurzu,项目名称:ildeposito8,代码行数:29,代码来源:WorkflowConfigTransition.php

示例6: save

 /**
  * {@inheritdoc}
  */
 public function save()
 {
     $return = parent::save();
     // Rebuild route information when browsers that register routes
     // are created/updated.
     \Drupal::service('router.builder')->rebuild();
     return $return;
 }
开发者ID:DrupalTV,项目名称:DrupalTV,代码行数:11,代码来源:EntityBrowser.php

示例7: save

 /**
  * Overrides Drupal\config\ConfigEntityBase::save().
  */
 public function save()
 {
     // Check if everything is valid.
     if (!$this->isValid()) {
         throw new InvalidBreakpointException('Invalid data detected.');
     }
     // Set the label if none is set.
     if (empty($this->label)) {
         $this->label = $this->name;
     }
     // Remove unused multipliers.
     $this->multipliers = array_filter($this->multipliers);
     // Always add '1x' multiplier, use array_key_exists since the value might
     // be NULL.
     if (!array_key_exists('1x', $this->multipliers)) {
         $this->multipliers = array('1x' => '1x') + $this->multipliers;
     }
     return parent::save();
 }
开发者ID:anatalsceo,项目名称:en-classe,代码行数:22,代码来源:Breakpoint.php

示例8: save

 /**
  * Overrides Drupal\Core\Entity::save().
  */
 public function save()
 {
     // Only save the keys, but return the full objects.
     $breakpoint_group = $this->getBreakpointGroup();
     if ($breakpoint_group && is_object($breakpoint_group)) {
         $this->setBreakpointGroup($breakpoint_group->id());
     }
     // Split the breakpoint ids into their different parts, as dots as
     // identifiers are not possible.
     $loaded_mappings = $this->mappings;
     $this->mappings = array();
     foreach ($loaded_mappings as $breakpoint_id => $mapping) {
         list($source_type, $source, $name) = explode('.', $breakpoint_id);
         $this->mappings[$source_type][$source][$name] = $mapping;
     }
     parent::save();
     $this->loadBreakpointGroup();
     $this->loadAllMappings();
 }
开发者ID:alnutile,项目名称:drunatra,代码行数:22,代码来源:ResponsiveImageMapping.php


注:本文中的Drupal\Core\Config\Entity\ConfigEntityBase::save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。