class QueryFactory in CiviCRM Entity 8.3
Factory class creating entity query objects in CiviCRM.
Hierarchy
- class \Drupal\civicrm_entity\Entity\Query\CiviCRM\QueryFactory implements QueryFactoryInterface
Expanded class hierarchy of QueryFactory
See also
\Drupal\civicrm_entity\Entity\Query\CiviCRM\Query
1 string reference to 'QueryFactory'
1 service uses QueryFactory
File
- src/
Entity/ Query/ CiviCRM/ QueryFactory.php, line 16
Namespace
Drupal\civicrm_entity\Entity\Query\CiviCRMView source
class QueryFactory implements QueryFactoryInterface {
/**
* The namespace of this class, the parent class etc.
*
* @var array
*/
protected $namespaces;
/**
* The CiviCRM API service.
*
* @var \Drupal\civicrm_entity\CiviCrmApiInterface
*/
protected $civicrmApi;
/**
* Constructs a QueryFactory object.
*
* @param \Drupal\civicrm_entity\CiviCrmApiInterface $civicrm_api
* The CiviCRM API bridge.
*/
public function __construct(CiviCrmApiInterface $civicrm_api) {
$this->namespaces = QueryBase::getNamespaces($this);
$this->civicrmApi = $civicrm_api;
}
/**
* {@inheritdoc}
*/
public function get(EntityTypeInterface $entity_type, $conjunction) {
// @todo copy paste, evaluate if they do.
if ($conjunction == 'OR') {
throw new QueryException("CiviCRM entity queries do not support OR conditions.");
}
$class = QueryBase::getClass($this->namespaces, 'Query');
return new $class($entity_type, $conjunction, $this->namespaces, $this->civicrmApi);
}
/**
* {@inheritdoc}
*/
public function getAggregate(EntityTypeInterface $entity_type, $conjunction) {
// @todo copy paste, evaluate if they do.
throw new QueryException("CiviCRM entity queries do not support aggregate queries.");
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
QueryFactory:: |
protected | property | The CiviCRM API service. | |
QueryFactory:: |
protected | property | The namespace of this class, the parent class etc. | |
QueryFactory:: |
public | function |
Instantiates an entity query for a given entity type. Overrides QueryFactoryInterface:: |
|
QueryFactory:: |
public | function |
Instantiates an aggregation query object for a given entity type. Overrides QueryFactoryInterface:: |
|
QueryFactory:: |
public | function | Constructs a QueryFactory object. |