Skip to content

Instantly share code, notes, and snippets.

View EclipseGc's full-sized avatar

Kris Vanderwater EclipseGc

View GitHub Profile
<?php
interface CToolsContextInterface {
/**
* Compares the context object's data type to the requested type.
*
* @param $type
* The data type to compare this context against.
*
<?php
// My field mappings:
$this->addFieldMapping('field_blog_images', 'url');
$this->addFieldMapping('field_blog_images:alt', 'image_alt');
$this->addFieldMapping('field_blog_images:title', 'image_title');
public function prepareRow($current_row) {
parent::prepareRow($current_row);
$query = Database::getConnection('swagonline')
<?php
class ctools_context_entity extends ctools_context {
public $entity_type;
public $entity_id;
public $revision_id;
<?php
use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_response_build().
*
* This is just a hook I made up to show how context might get calculated per
* page/variant.
*/
diff --git a/lib/Drupal/config_translation/ConfigMapperManager.php b/lib/Drupal/config_translation/ConfigMapperManager.php
index 59cfb01..3076a76 100644
--- a/lib/Drupal/config_translation/ConfigMapperManager.php
+++ b/lib/Drupal/config_translation/ConfigMapperManager.php
@@ -57,13 +57,6 @@ class ConfigMapperManager extends DefaultPluginManager {
}
/**
- * {@inheritdoc}
- */
<?php
/**
* @file
* Contains \Drupal\Component\Plugin\PluginBase
*/
namespace Drupal\Component\Plugin;
/**
* Base class for plugins wishing to support metadata inspection.
<?php
public function __construct(array $configuration, $plugin_id, array $plugin_definition) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->configuration += $this->settings() + array(
'label' => '',
'module' => $plugin_definition['module'],
'label_display' => BlockInterface::BLOCK_LABEL_VISIBLE,
{
"require": {
"symfony/class-loader": "2.3.*",
"symfony/http-foundation": "2.3.*",
"symfony/http-kernel": "2.3.*",
"symfony/event-dispatcher": "~2.3",
"symfony/dependency-injection": "~2.3",
"symfony/routing": "2.3.*",
"symfony/config": "2.3.*",
"symfony/validator": "2.3.*",
<?php
namespace Drupal\Core\Database;
class DatabaseSelect {
/**
* @var \Drupal\Core\Database\Connection $connection
*/
protected $connection;
<?php
function db_select($table, $alias = NULL, array $options = array()) {
if (empty($options['target'])) {
$options['target'] = 'default';
}
return Database::getConnection($options['target'])->select($table, $alias, $options);
}