• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP source\DrupalSqlBase类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase的典型用法代码示例。如果您正苦于以下问题:PHP DrupalSqlBase类的具体用法?PHP DrupalSqlBase怎么用?PHP DrupalSqlBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: prepareRow

 /**
  * {@inheritdoc}
  */
 public function prepareRow(Row $row)
 {
     $vocab = $row->getSourceProperty('taxonomy');
     $label = $vocab == 'category' ? 'Category' : 'Post Tags';
     $row->setSourceProperty('label', $label);
     return parent::prepareRow($row);
 }
开发者ID:gl-prout,项目名称:d8_migrate_wordpress,代码行数:10,代码来源:Vocabulary.php


示例2: prepareRow

  /**
   * {@inheritdoc}
   */
  public function prepareRow(Row $row) {
    // User roles.
    $roles = $this->select('users_roles', 'ur')
      ->fields('ur', array('rid'))
      ->condition('ur.uid', $row->getSourceProperty('uid'))
      ->execute()
      ->fetchCol();
    $row->setSourceProperty('roles', $roles);

    // We are adding here the Event contributed module column.
    // @see https://api.drupal.org/api/drupal/modules%21user%21user.install/function/user_update_7002/7
    if ($row->hasSourceProperty('timezone_id') && $row->getSourceProperty('timezone_id')) {
      if ($this->getDatabase()->schema()->tableExists('event_timezones')) {
        $event_timezone = $this->select('event_timezones', 'e')
          ->fields('e', array('name'))
          ->condition('e.timezone', $row->getSourceProperty('timezone_id'))
          ->execute()
          ->fetchField();
        if ($event_timezone) {
          $row->setSourceProperty('event_timezone', $event_timezone);
        }
      }
    }

    // Unserialize Data.
    $row->setSourceProperty('data', unserialize($row->getSourceProperty('data')));

    return parent::prepareRow($row);
  }
开发者ID:Greg-Boggs,项目名称:electric-dev,代码行数:32,代码来源:User.php


示例3: prepareRow

 /**
  * {@inheritdoc}
  */
 public function prepareRow(Row $row)
 {
     $row->setSourceProperty('filename', basename($row->getSourceProperty('picture')));
     $row->setSourceProperty('file_directory_path', $this->filePath);
     $row->setSourceProperty('temp_directory_path', $this->tempFilePath);
     return parent::prepareRow($row);
 }
开发者ID:dev981,项目名称:gaptest,代码行数:10,代码来源:UserPictureFile.php


示例4: prepareRow

 /**
  * {@inheritdoc}
  */
 public function prepareRow(Row $row)
 {
     if ($value = $row->getSourceProperty('value')) {
         $row->setSourceProperty('value', unserialize($value));
     }
     return parent::prepareRow($row);
 }
开发者ID:aWEBoLabs,项目名称:taxi,代码行数:10,代码来源:VariableMultiRow.php


示例5: prepareRow

 /**
  * {@inheritdoc}
  */
 public function prepareRow(Row $row)
 {
     $row->setSourceProperty('options', unserialize($row->getSourceProperty('options')));
     $row->setSourceProperty('enabled', !$row->getSourceProperty('hidden'));
     $row->setSourceProperty('description', Unicode::truncate($row->getSourceProperty('options/attributes/title'), 255));
     return parent::prepareRow($row);
 }
开发者ID:aWEBoLabs,项目名称:taxi,代码行数:10,代码来源:MenuLink.php


示例6: prepareRow

 /**
  * {@inheritdoc}
  */
 public function prepareRow(Row $row)
 {
     // Select all related tickets (rnid) to the current ticket (nid)
     $query = $this->select('support_reference', 'sr')->fields('sr', array('rnid'))->condition('sr.nid', $row->getSourceProperty('nid'));
     $row->setSourceProperty('rnid', $query->execute()->fetchCol());
     return parent::prepareRow($row);
 }
开发者ID:justincletus,项目名称:webdrupalpro,代码行数:10,代码来源:SupportTicketReference.php


示例7: prepareRow

  /**
   * {@inheritdoc}
   */
  public function prepareRow(Row $row) {
    // Find profile values for this row.
    $query = $this->select('profile_values', 'pv')
      ->fields('pv', array('fid', 'value'));
    $query->leftJoin('profile_fields', 'pf', 'pf.fid=pv.fid');
    $query->fields('pf', array('name', 'type'));
    $query->condition('uid', $row->getSourceProperty('uid'));
    $results = $query->execute();

    foreach ($results as $profile_value) {
      // Check special case for date. We need to unserialize.
      if ($profile_value['type'] == 'date') {
        $date = unserialize($profile_value['value']);
        $date = date('Y-m-d', mktime(0, 0, 0, $date['month'], $date['day'], $date['year']));
        $row->setSourceProperty($profile_value['name'], array('value' => $date));
      }
      elseif ($profile_value['type'] == 'list') {
        // Explode by newline and comma.
        $row->setSourceProperty($profile_value['name'], preg_split("/[\r\n,]+/", $profile_value['value']));
      }
      else {
        $row->setSourceProperty($profile_value['name'], array($profile_value['value']));
      }
    }

    return parent::prepareRow($row);
  }
开发者ID:Greg-Boggs,项目名称:electric-dev,代码行数:30,代码来源:ProfileFieldValues.php


示例8: prepareRow

 /**
  * {@inheritdoc}
  */
 public function prepareRow(Row $row)
 {
     $row->setSourceProperty('file_directory_path', $this->filePath);
     $row->setSourceProperty('temp_directory_path', $this->tempFilePath);
     $row->setSourceProperty('is_public', $this->isPublic);
     return parent::prepareRow($row);
 }
开发者ID:ravindrasingh22,项目名称:Drupal-8-rc,代码行数:10,代码来源:File.php


示例9: prepareRow

 /**
  * {@inheritdoc}
  */
 public function prepareRow(Row $row)
 {
     $post_type = $row->getSourceProperty('post_type');
     $type = $post_type == 'page' ? 'page' : 'article';
     $row->setSourceProperty('type', $type);
     return parent::prepareRow($row);
 }
开发者ID:gl-prout,项目名称:d8_migrate_wordpress,代码行数:10,代码来源:Posts.php


示例10: prepareRow

 /**
  * {@inheritdoc}
  */
 public function prepareRow(Row $row)
 {
     $type = $row->getSourceProperty('type');
     $row->setSourceProperty('language_content_type', $this->variableGet('language_content_type_' . $type, NULL));
     $row->setSourceProperty('i18n_lock_node', $this->variableGet('i18n_lock_node_' . $type, 0));
     return parent::prepareRow($row);
 }
开发者ID:eigentor,项目名称:tommiblog,代码行数:10,代码来源:LanguageContentSettings.php


示例11: prepareRow

 /**
  * {@inheritdoc}
  */
 public function prepareRow(Row $row)
 {
     $filters = array();
     $roles = $row->getSourceProperty('roles');
     $row->setSourceProperty('roles', array_values(array_filter(explode(',', $roles))));
     $format = $row->getSourceProperty('format');
     // Find filters for this row.
     $results = $this->select('filters', 'f')->fields('f', array('module', 'delta', 'weight'))->condition('format', $format)->execute();
     foreach ($results as $raw_filter) {
         $module = $raw_filter['module'];
         $delta = $raw_filter['delta'];
         $filter = array('module' => $module, 'delta' => $delta, 'weight' => $raw_filter['weight'], 'settings' => array());
         // Load the filter settings for the filter module, modules can use
         // hook_migration_d6_filter_formats_prepare_row() to add theirs.
         if ($raw_filter['module'] == 'filter') {
             if (!$delta) {
                 if ($setting = $this->variableGet("allowed_html_{$format}", NULL)) {
                     $filter['settings']['allowed_html'] = $setting;
                 }
                 if ($setting = $this->variableGet("filter_html_help_{$format}", NULL)) {
                     $filter['settings']['filter_html_help'] = $setting;
                 }
                 if ($setting = $this->variableGet("filter_html_nofollow_{$format}", NULL)) {
                     $filter['settings']['filter_html_nofollow'] = $setting;
                 }
             } elseif ($delta == 2 && ($setting = $this->variableGet("filter_url_length_{$format}", NULL))) {
                 $filter['settings']['filter_url_length'] = $setting;
             }
         }
         $filters[] = $filter;
     }
     $row->setSourceProperty('filters', $filters);
     return parent::prepareRow($row);
 }
开发者ID:papillon-cendre,项目名称:d8,代码行数:37,代码来源:FilterFormat.php


示例12: prepareRow

 /**
  * {@inheritdoc}
  */
 public function prepareRow(Row $row)
 {
     $data = unserialize($row->getSourceProperty('data'));
     $row->setSourceProperty('widget', $data['widget']);
     $row->setSourceProperty('widget_settings', $data['widget']['settings']);
     return parent::prepareRow($row);
 }
开发者ID:eigentor,项目名称:tommiblog,代码行数:10,代码来源:FieldInstancePerFormDisplay.php


示例13: prepareRow

 /**
  * {@inheritdoc}
  */
 public function prepareRow(Row $row)
 {
     $row->setSourceProperty('teaser_length', $this->teaserLength);
     $row->setSourceProperty('node_preview', $this->nodePreview);
     $type = $row->getSourceProperty('type');
     $source_options = $this->variableGet('node_options_' . $type, array('promote', 'sticky'));
     $options = array();
     foreach (array('promote', 'sticky', 'status', 'revision') as $item) {
         $options[$item] = in_array($item, $source_options);
     }
     $row->setSourceProperty('options', $options);
     // Don't create a body field until we prove that this node type has one.
     $row->setSourceProperty('create_body', FALSE);
     if ($this->moduleExists('field')) {
         // Find body field for this node type.
         $body = $this->select('field_config_instance', 'fci')->fields('fci', array('data'))->condition('entity_type', 'node')->condition('bundle', $row->getSourceProperty('type'))->condition('field_name', 'body')->execute()->fetchAssoc();
         if ($body) {
             $row->setSourceProperty('create_body', TRUE);
             $body['data'] = unserialize($body['data']);
             $row->setSourceProperty('body_label', $body['data']['label']);
         }
     }
     $row->setSourceProperty('display_submitted', $this->variableGet('node_submitted_' . $type, TRUE));
     return parent::prepareRow($row);
 }
开发者ID:ddrozdik,项目名称:dmaps,代码行数:28,代码来源:NodeType.php


示例14: prepareRow

 /**
  * {@inheritdoc}
  */
 public function prepareRow(Row $row)
 {
     // Find parents for this row.
     $parents = $this->select('term_hierarchy', 'th')->fields('th', array('parent', 'tid'))->condition('tid', $row->getSourceProperty('tid'))->execute()->fetchCol();
     $row->setSourceProperty('parent', $parents);
     return parent::prepareRow($row);
 }
开发者ID:nsp15,项目名称:Drupal8,代码行数:10,代码来源:Term.php


示例15: prepareRow

 /**
  * {@inheritdoc}
  */
 public function prepareRow(Row $row, $keep = TRUE)
 {
     foreach (unserialize($row->getSourceProperty('data')) as $key => $value) {
         $row->setSourceProperty($key, $value);
     }
     return parent::prepareRow($row);
 }
开发者ID:aWEBoLabs,项目名称:taxi,代码行数:10,代码来源:Field.php


示例16: initializeIterator

 /**
  * {@inheritdoc}
  */
 protected function initializeIterator()
 {
     $this->publicPath = $this->variableGet('file_public_path', 'sites/default/files');
     $this->privatePath = $this->variableGet('file_private_path', NULL);
     $this->temporaryPath = $this->variableGet('file_temporary_path', '/tmp');
     return parent::initializeIterator();
 }
开发者ID:scratch,项目名称:gai,代码行数:10,代码来源:File.php


示例17: prepareRow

 /**
  * {@inheritdoc}
  */
 public function prepareRow(Row $row)
 {
     $query = $this->select('upload', 'u')->fields('u', array('fid', 'description', 'list'))->condition('u.nid', $row->getSourceProperty('nid'))->orderBy('u.weight');
     $query->innerJoin('node', 'n', static::JOIN);
     $row->setSourceProperty('upload', $query->execute()->fetchAll());
     return parent::prepareRow($row);
 }
开发者ID:briefmedia-digital,项目名称:drupal8,代码行数:10,代码来源:Upload.php


示例18: prepareRow

 /**
  * {@inheritdoc}
  */
 public function prepareRow(Row $row)
 {
     // Find node types for this row.
     $node_types = $this->select('vocabulary_node_types', 'nt')->fields('nt', array('type', 'vid'))->condition('vid', $row->getSourceProperty('vid'))->execute()->fetchCol();
     $row->setSourceProperty('node_types', $node_types);
     return parent::prepareRow($row);
 }
开发者ID:ddrozdik,项目名称:dmaps,代码行数:10,代码来源:Vocabulary.php


示例19: prepareRow

 /**
  * {@inheritdoc}
  */
 public function prepareRow(Row $row)
 {
     parent::prepareRow($row);
     $status = $row->getSourceProperty('status');
     $nid = $row->getSourceProperty('nid');
     $row->setSourceProperty('identifier', 'node/' . $nid);
 }
开发者ID:MGApcDev,项目名称:MGApcDevCom,代码行数:10,代码来源:DisqusCommentsStatus.php


示例20: prepareRow

 /**
  * {@inheritdoc}
  */
 public function prepareRow(Row $row)
 {
     // Find node types for this row.
     $node_types = $this->select('vocabulary_node_types', 'nt')->fields('nt', array('type', 'vid'))->condition('vid', $row->getSourceProperty('vid'))->execute()->fetchCol();
     $row->setSourceProperty('node_types', $node_types);
     $row->setSourceProperty('cardinality', $row->getSourceProperty('tags') == 1 || $row->getSourceProperty('multiple') == 1 ? FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED : 1);
     return parent::prepareRow($row);
 }
开发者ID:aWEBoLabs,项目名称:taxi,代码行数:11,代码来源:Vocabulary.php



注:本文中的Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Tests\MigrateDrupalTestBase类代码示例发布时间:2022-05-23
下一篇:
PHP Entity\Migration类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap