src/DataDefinition/Palette/Builder/PaletteBuilder.php
public function chainPropertyValueCondition(
        $propertyName,
        $propertyValue,
        $strict = false,
        $conjunction = PropertyConditionChain::AND_CONJUNCTION
    ) {
        if ($this->property) {
            $this->createPropertyConditionChain($conjunction);
            $condition = $this->propertyValueConditionClass->newInstance();
        } elseif ($this->palette) {
            $this->createPaletteConditionChain();
            $condition = $this->palettePropertyValueConditionClass->newInstance();
        } else {
            throw new DcGeneralRuntimeException(
                'Does not know where to create the property-value condition, please create a palette or property first'
            );
        }

        $condition->setPropertyName($propertyName);
        $condition->setPropertyValue($propertyValue);
        $condition->setStrict($strict);

        $event = new CreatePropertyValueConditionEvent($condition, $this);
        $this->dispatchEvent($event);
        $condition = $event->getPropertyValueCondition();

        $event = new CreateConditionEvent($condition, $this);
        $this->dispatchEvent($event);
        $condition = $event->getCondition();

        $this->condition->addCondition($condition);

        return $this;
    }
public function chainPropertyValueCondition(
        $propertyName,
        $propertyValue,
        $strict = false,
        $conjunction = PropertyConditionChain::AND_CONJUNCTION
    ) {
        if ($this->property) {
            $this->createPropertyConditionChain($conjunction);
            $condition = $this->propertyValueConditionClass->newInstance();
        } elseif ($this->palette) {
            $this->createPaletteConditionChain();
            $condition = $this->palettePropertyValueConditionClass->newInstance();
        } else {
            throw new DcGeneralRuntimeException(
                'Does not know where to create the property-value condition, please create a palette or property first'
            );
        }

        $condition->setPropertyName($propertyName);
        $condition->setPropertyValue($propertyValue);
        $condition->setStrict($strict);

        $event = new CreatePropertyValueConditionEvent($condition, $this);
        $this->dispatchEvent($event);
        $condition = $event->getPropertyValueCondition();

        $event = new CreateConditionEvent($condition, $this);
        $this->dispatchEvent($event);
        $condition = $event->getCondition();

        $this->condition->addCondition($condition);

        return $this;
    }
public function chainPropertyValueCondition ( $ propertyName , $ propertyValue , $ strict = false , $ conjunction = PropertyConditionChain :: AND_CONJUNCTION ) { if ( $ this -> property ) { $ this -> createPropertyConditionChain ( $ conjunction ) ; $ condition = $ this -> propertyValueConditionClass -> newInstance ( ) ; } elseif ( $ this -> palette ) { $ this -> createPaletteConditionChain ( ) ; $ condition = $ this -> palettePropertyValueConditionClass -> newInstance ( ) ; } else { throw new DcGeneralRuntimeException ( 'Does not know where to create the property-value condition, please create a palette or property first' ) ; } $ condition -> setPropertyName ( $ propertyName ) ; $ condition -> setPropertyValue ( $ propertyValue ) ; $ condition -> setStrict ( $ strict ) ; $ event = new CreatePropertyValueConditionEvent ( $ condition , $ this ) ; $ this -> dispatchEvent ( $ event ) ; $ condition = $ event -> getPropertyValueCondition ( ) ; $ event = new CreateConditionEvent ( $ condition , $ this ) ; $ this -> dispatchEvent ( $ event ) ; $ condition = $ event -> getCondition ( ) ; $ this -> condition -> addCondition ( $ condition ) ; return $ this ; }
Start a new property-value condition and chain with previous condition.

@param string $propertyName  The name of the property.
@param mixed  $propertyValue The value of the property.
@param bool   $strict        Flag if the comparison shall be strict (type safe).
@param string $conjunction   The conjunction.

@return PaletteBuilder

@throws DcGeneralRuntimeException If neither a palette nor a property is stored in the builder.
Start a new property - value condition and chain with previous condition .