LdapTools\Query\Operator\BaseOperator::getWasConverterUsed PHP Method

getWasConverterUsed() public method

Get whether a converter was used or not.
public getWasConverterUsed ( string | null $alias = null ) : boolean
$alias string | null
return boolean
    public function getWasConverterUsed($alias = null)
    {
        if ($alias) {
            return isset($this->converterAliasUsed[$alias]) ? $this->converterAliasUsed[$alias] : false;
        } else {
            return $this->converterUsed;
        }
    }

Usage Example

 /**
  * @param BaseOperator $operator
  * @param string|null $alias
  * @oaran string $alias
  */
 protected function processOperator(BaseOperator $operator, $alias)
 {
     if ($operator instanceof ContainsOperatorsInterface) {
         foreach ($operator->getChildren() as $childOperator) {
             $this->processOperator($childOperator, $alias);
         }
     } elseif (!$operator->getWasConverterUsed($alias) && $this->schema->hasConverter($operator->getAttribute())) {
         $this->convertOperatorValues($operator, $alias);
     }
     $operator->setTranslatedAttribute($this->schema->getAttributeToLdap($operator->getAttribute()), $alias);
 }