class Condition in CiviCRM Entity 8.3
Implements entity query conditions for CiviCRM.
Hierarchy
- class \Drupal\Core\Entity\Query\ConditionFundamentals
- class \Drupal\Core\Entity\Query\ConditionBase implements ConditionInterface
- class \Drupal\civicrm_entity\Entity\Query\CiviCRM\Condition
- class \Drupal\Core\Entity\Query\ConditionBase implements ConditionInterface
Expanded class hierarchy of Condition
File
- src/
Entity/ Query/ CiviCRM/ Condition.php, line 11
Namespace
Drupal\civicrm_entity\Entity\Query\CiviCRMView source
class Condition extends ConditionBase {
/**
* The CiviCRM entity query object this condition belongs to.
*
* @var \Drupal\civicrm_entity\Entity\Query\CiviCRM\Query
*/
protected $query;
/**
* {@inheritdoc}
*/
public function compile($condition_container) {
// If this is not the top level condition group then the sql query is
// added to the $conditionContainer object by this function itself. The
// SQL query object is only necessary to pass to Query::addField() so it
// can join tables as necessary. On the other hand, conditions need to be
// added to the $conditionContainer object to keep grouping.
foreach ($this->conditions as $condition) {
if ($condition['field'] instanceof ConditionInterface) {
$query_condition = new static('AND', $this->query);
$query_condition
->compile($condition_container);
}
else {
$condition_container
->setParameter($condition['field'], $condition['value']);
}
}
}
/**
* {@inheritdoc}
*/
public function exists($field, $langcode = NULL) {
return $this
->condition($field, NULL, 'IS NOT NULL', $langcode);
}
/**
* {@inheritdoc}
*/
public function notExists($field, $langcode = NULL) {
return $this
->condition($field, NULL, 'IS NULL', $langcode);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Condition:: |
protected | property |
The CiviCRM entity query object this condition belongs to. Overrides ConditionFundamentals:: |
|
Condition:: |
public | function |
Compiles this conditional clause. Overrides ConditionInterface:: |
|
Condition:: |
public | function |
Queries for the existence of a field. Overrides ConditionInterface:: |
|
Condition:: |
public | function |
Queries for the nonexistence of a field. Overrides ConditionInterface:: |
|
ConditionBase:: |
public | function |
Adds a condition. Overrides ConditionInterface:: |
|
ConditionFundamentals:: |
protected | property | Array of conditions. | |
ConditionFundamentals:: |
protected | property | The conjunction of this condition group. The value is one of the following: | |
ConditionFundamentals:: |
protected | property | List of potential namespaces of the classes belonging to this condition. | |
ConditionFundamentals:: |
public | function | ||
ConditionFundamentals:: |
public | function | ||
ConditionFundamentals:: |
public | function | ||
ConditionFundamentals:: |
public | function | Implements the magic __clone function. | |
ConditionFundamentals:: |
public | function | Constructs a Condition object. |