예제 #1
0
 /**
  * Constructs a Query object.
  *
  * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
  *   The entity type definition.
  * @param string $conjunction
  *   - AND: all of the conditions on the query need to match.
  *   - OR: at least one of the conditions on the query need to match.
  * @param \Drupal\Core\Config\StorageInterface $config_storage
  *   The actual config storage which is used to list all config items.
  * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
  *   The config factory.
  * @param array $namespaces
  *   List of potential namespaces of the classes belonging to this query.
  */
 function __construct(EntityTypeInterface $entity_type, $conjunction, StorageInterface $config_storage, ConfigFactoryInterface $config_factory, array $namespaces)
 {
     parent::__construct($entity_type, $conjunction, $namespaces);
     $this->configStorage = $config_storage;
     $this->configFactory = $config_factory;
 }
예제 #2
0
파일: Query.php 프로젝트: aWEBoLabs/taxi
 /**
  * Constructs a new Query.
  *
  * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
  *   The entity type.
  * @param string $conjunction
  *   - AND: all of the conditions on the query need to match.
  *   - OR: at least one of the conditions on the query need to match.
  * @param array $namespaces
  *   List of potential namespaces of the classes belonging to this query.
  * @param \Drupal\Core\KeyValueStore\KeyValueFactoryInterface $key_value_factory
  *   The key value factory.
  */
 public function __construct(EntityTypeInterface $entity_type, $conjunction, array $namespaces, KeyValueFactoryInterface $key_value_factory)
 {
     parent::__construct($entity_type, $conjunction, $namespaces);
     $this->keyValueFactory = $key_value_factory;
 }
예제 #3
0
 /**
  * Constructs a query object.
  *
  * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
  *   The entity type definition.
  * @param string $conjunction
  *   - AND: all of the conditions on the query need to match.
  *   - OR: at least one of the conditions on the query need to match.
  * @param \Drupal\Core\Database\Connection $connection
  *   The database connection to run the query against.
  * @param array $namespaces
  *   List of potential namespaces of the classes belonging to this query.
  */
 public function __construct(EntityTypeInterface $entity_type, $conjunction, Connection $connection, array $namespaces)
 {
     parent::__construct($entity_type, $conjunction, $namespaces);
     $this->connection = $connection;
 }
예제 #4
0
 /**
  * Constructs a query object.
  *
  * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
  *   The entity type definition.
  * @param string $conjunction
  *   - AND: all of the conditions on the query need to match.
  *   - OR: at least one of the conditions on the query need to match.
  * @param \Drupal\rdf_entity\Database\Driver\sparql\Connection $connection
  *   The database connection to run the query against.
  * @param array $namespaces
  *   List of potential namespaces of the classes belonging to this query.
  * @param \Drupal\Core\Entity\EntityTypeManager $entity_type_manager
  *   The entity type manager service object.
  * @param \Drupal\rdf_entity\RdfGraphHandler $rdf_graph_handler
  *    The rdf graph handler service.
  * @param \Drupal\rdf_entity\RdfMappingHandler $rdf_mapping_handler
  *    The rdf mapping handler service.
  *
  * @throws \Exception
  *   Thrown when the storage passed is not an RdfEntitySparqlStorage.
  *
  * @todo: Is this exception check needed?
  */
 public function __construct(EntityTypeInterface $entity_type, $conjunction, Connection $connection, array $namespaces, EntityTypeManager $entity_type_manager, RdfGraphHandler $rdf_graph_handler, RdfMappingHandler $rdf_mapping_handler)
 {
     parent::__construct($entity_type, $conjunction, $namespaces);
     $this->filter = new SparqlFilter();
     $this->connection = $connection;
     $this->entityTypeManager = $entity_type_manager;
     $this->entityStorage = $this->entityTypeManager->getStorage($this->entityTypeId);
     $this->graphHandler = $rdf_graph_handler;
     $this->mappingHandler = $rdf_mapping_handler;
     if (!$this->entityStorage instanceof RdfEntitySparqlStorage) {
         throw new \Exception('Sparql storage is required for this query.');
     }
 }