diff --git a/core/modules/entity/lib/Drupal/entity/ConfigQuery/Condition.php b/core/modules/entity/lib/Drupal/entity/ConfigQuery/Condition.php index 74d7cc6..ee507e3 100644 --- a/core/modules/entity/lib/Drupal/entity/ConfigQuery/Condition.php +++ b/core/modules/entity/lib/Drupal/entity/ConfigQuery/Condition.php @@ -33,7 +33,11 @@ public function compile($conditionContainer) { $sqlQuery = $conditionContainer->sqlQuery; } + // Iterate over all conditions and act based on whether they are a condition + // group or a single condition. foreach ($this->conditions as $condition) { + // If it's a condition group, compile the condition group and add it to + // the sql. if ($condition['field'] instanceOf ConditionInterface) { $sqlCondition = new SqlCondition($condition['field']->getConjunction()); // Add the SQL query to the object before calling this method again. @@ -41,6 +45,7 @@ public function compile($conditionContainer) { $condition['field']->compile($sqlCondition); $sqlQuery->condition($sqlCondition); } + // If it's a simple condition apply the query logic. else { $and = strtoupper($this->conjunction) == 'AND'; $or = !$and; @@ -80,7 +85,16 @@ public function notExists($field, $langcode = NULL) { return $this->condition($field, NULL, 'IS NULL', $langcode); } - protected function translateCondition(&$condition) { + /** + * Translates a condition array to it's sql equivalents. + * + * @param array $condition + * An associative array containing the follow keys: + * - field: The entity property to filter on. + * - operator: The operator used in the condition, for example "=". + * - value: The actual value to filter by. + */ + protected function translateCondition(array &$condition) { if (strpos($condition['field'], '*') === FALSE) { $condition['field_operator'] = '='; } diff --git a/core/modules/entity/lib/Drupal/entity/ConfigQuery/Denormalize.php b/core/modules/entity/lib/Drupal/entity/ConfigQuery/Denormalize.php index d28c825..b2100d5 100644 --- a/core/modules/entity/lib/Drupal/entity/ConfigQuery/Denormalize.php +++ b/core/modules/entity/lib/Drupal/entity/ConfigQuery/Denormalize.php @@ -35,11 +35,15 @@ class Denormalize implements EventSubscriberInterface { protected $entityID; /** - * @var \Drupal\config\Config + * The config object to react on. + * + * @var \Drupal\Core\Config\Config */ protected $config; /** + * A database insert object to put the config values into the table. + * * @var \Drupal\Core\Database\Query\Insert */ public $insert; @@ -51,7 +55,7 @@ public function __construct(Connection $connection) { /** * Reacts on the config.save event to denormalize the entity values. * - * @param \Drupal\config\ConfigEvent $event + * @param \Drupal\Core\Config\ConfigEvent $event * The config event object containing the config object being written. */ public function configSave(ConfigEvent $event) { @@ -68,7 +72,7 @@ public function configSave(ConfigEvent $event) { /** * Reacts on the config.delete event to remove the entity values. * - * @param \Drupal\config\ConfigEvent $event + * @param \Drupal\Core\Config\ConfigEvent $event * The config event object containing the config object being written. */ public function configDelete(ConfigEvent $event) { diff --git a/core/modules/entity/lib/Drupal/entity/ConfigQuery/Query.php b/core/modules/entity/lib/Drupal/entity/ConfigQuery/Query.php index 132bb31..8cea0b1 100644 --- a/core/modules/entity/lib/Drupal/entity/ConfigQuery/Query.php +++ b/core/modules/entity/lib/Drupal/entity/ConfigQuery/Query.php @@ -21,6 +21,8 @@ class Query extends QueryBase { protected $connection; /** + * Constructs a Query object. + * * @param string $entity_type * The entity type. * @param string $conjunction diff --git a/core/modules/entity/lib/Drupal/entity/EntityBundle.php b/core/modules/entity/lib/Drupal/entity/EntityBundle.php index 41df745..303055f 100644 --- a/core/modules/entity/lib/Drupal/entity/EntityBundle.php +++ b/core/modules/entity/lib/Drupal/entity/EntityBundle.php @@ -15,6 +15,7 @@ * Bundle class for entity services. */ class EntityBundle extends Bundle { + /** * Implements \Symfony\Component\HttpKernel\Bundle\BundleInterface::build(). */ @@ -25,4 +26,5 @@ public function build(ContainerBuilder $container) { ->addArgument(new Reference('database')) ->addTag('event_subscriber'); } + }