@param object $input

@throws AttributeSetException
192644
private function checkAttributes($input)
    {
        if (!$this->hasValidStructure($input)) {
            $unknown = $this->checkValidStructure($input);

            $params = [];
            if (count($unknown) !== 0) {
                $params['attributes'] = $unknown;
            }
            $exception = $this->reportError($input, $params);

            throw $exception;
        }
    }
1226771
protected function arrayToConditionDataModel(array $input)
    {
        /** @var \Smile\ElasticsuiteCatalogRule\Model\Data\Condition $conditionDataModel */
        $conditionDataModel = $this->conditionDataFactory->create();
        foreach ($input as $key => $value) {
            switch ($key) {
                case 'type':
                    $conditionDataModel->setConditionType($value);
                    break;
                case 'attribute':
                    $conditionDataModel->setAttributeName($value);
                    break;
                case 'operator':
                    $conditionDataModel->setOperator($value);
                    break;
                case 'value':
                    $conditionDataModel->setValue($value);
                    break;
                case 'aggregator':
                    $conditionDataModel->setAggregatorType($value);
                    break;
                case 'conditions':
                    $conditions = [];
                    foreach ($value as $condition) {
                        $conditions[] = $this->arrayToConditionDataModel($condition);
                    }
                    $conditionDataModel->setConditions($conditions);
                    break;
                default:
            }
        }

        return $conditionDataModel;
    }
374627
protected function _fromJson($input)
    {
        $obj = json_decode($input, true);

        if($obj === false) {
            throw new \DomainException('Error decoding JSON data');
        }

        return $obj;
    }
302571
public function classSet( $input )
    {

        if( is_object( $input ) ) {
            if( $input instanceof self ) {
                $class = $input->classGet();
            } else {
                $class = get_class( $input );
            }
        } else {
            $class = $input;
        }

        $currentClass = $this->classGet();
        if( $currentClass ) {
            if( $class !== $currentClass ) {
                throw new \LogicException( "Container has a class already ({$currentClass}) and it differs from your new one ({$class})" );
            }
            return false;
        }
        $this->class = $class;
        return true;
    }
713480
public function setInput($input)
    {
        $this->input    = $input;

        $this->pos      = 0;

        $this->line     = 0;

        $this->linePos  = 0;

        $this->tokenType = TokenType::BOF;

        $this->tokenValue = null;

        $this->length   = strlen($this->input);
    }
1006208
public static function clearInput($input)
    {
        if (is_array($input)) {
            foreach ($input as $key => $value) {
                if (!isset($value) || $value === '') {
                    unset($input[$key]);
                }
            }

            return $input;
        }

        return $input;
    }
16828
public function before($input): self {
        $this->manipulateNodesWithInput($input, function($node, $newNodes) {
            foreach ($newNodes as $newNode) {
                $node->parent()->insertBefore($newNode, $node);
            }
        });

        return $this;
    }
770850
public function convert(array $input) {
        //Convert to objects
        if (isSet($input['XDEBUG_SESSION_START'])) unset($input['XDEBUG_SESSION_START']);
        $returnVar = new \stdClass();
        foreach($input as $name => $value) {
            $parts = explode($this->getDelimiter(), $name);
            $currentPart = $returnVar;
            $count = sizeOf($parts);
            foreach($parts as $key => $part) {
                //Ignore all that have a blank part
                if($part == '') {
                    break;
                }
                if($key + 1 == $count) {
                    $currentPart->{$part} = $value;
                } else {
                    $part = ucfirst($part);
                    if(!isset($currentPart->{$part})) {
                        $item = new \stdClass();
                        $currentPart->{$part} = $item;
                    } else {
                        //Account for the url of ?employeeType&employeeType.name=1099 with employeeType and employeeType.name
                        if(!is_object($currentPart->{$part})) {
                            throw new Exception('You cannot pass in both ' . $part . ', and ' . implode('.', $parts), 400);
                        }
                    }
                    $currentPart = $currentPart->{$part};
                }
            }
        }
        return $returnVar;
    }
1028246
private function initialise(array $input = array())
	{
		foreach ($input as $key => $object)
		{
			if ($object !== null)
			{
				$this->offsetSet($key, $object);
			}
		}

		$this->rewind();
	}
995428
protected function resolveValues(&$input = null)
    {
        if (is_array($input)) {
            foreach ($input as $idx => $value) {
                $this->resolveValues($value);
                $input[$idx] = $value;
            }
        } else {
            if (!is_object($input)) {
                $input = $this->placeholderResolver()->resolvePlaceholder($input);
            }
        }
    }
473800
private function checkValidStructure($input)
    {
        $mirror = ($input) ? (array)$input : [];

        foreach ($this->getRules() as $attributeRule) {
            if (array_key_exists($attributeRule->reference, $mirror)) {
                unset($mirror[$attributeRule->reference]);
            }
        }

        return array_keys($mirror);
    }
994008
public function onInput($input)
    {
        foreach ($this->loopListeners as $listeners) {
            if (($return = $listeners->onInput($this, $input)) !== null) {
                $input = $return;
            }
        }

        return $input;
    }
511595
public function validate($input): bool
    {
        $this->exception = new ValidatorException();

        // run chains
        foreach ($this->validators as $key => $validators) {
            // skip validation for non required elements
            if (!isset($input[$key]) && !$validators->isRequired()) {
                continue;
            }
            $this->validateItem($key, $input[$key] ?? null);
        }

        return !$this->hasErrors();
    }
984039
private function _initialise(array $input = array())
	{
		foreach ($input as $key => $object)
		{
			if (!is_null($object))
			{
				$this->offsetSet($key, $object);
			}
		}

		$this->rewind();
	}
302773
public function create($input)
	{
		$mapper = $this->getMapper();
		$admin  = $mapper->getAdmin();

		$model      = $this->getModel();
		$primaryKey = (new $model)->getKeyName();

		$this->setInput($input);

		// Field pre update
		foreach ($mapper->getFields() as $field) {
			$field->preUpdate();
			$input = $this->getInput();

			// Is this a multiple field?
			if ($field->isMultiple()) {
				$value = Value::encode(Config::get('bauhaus::admin.multiple-serializer'), $input[$field->getName()]);
				$this->setInputVariable($field->getName(), $value);
			}

			if ($field->hasSaving()) {
				$saving = $field->getSaving();
				$this->setInputVariable($field->getName(), $saving($input[$field->getName()]));
			}
		}

		// Model before create hook
		if (method_exists($admin, 'beforeCreate')) {
			$admin->beforeCreate($input);
		}

		// Validate
		if (property_exists($model, 'rules')) {
			$validator = Validator::make($this->getInput(), $model::$rules);
			if ($validator->fails()) {
				return $validator;
			}
		}

		// Model create hook
		if (method_exists($admin, 'create')) {
			$model = $admin->create($this->getInput());
		} else {
			$model = $model::create($this->getInput());
		}

		// Set the primary id from the `new` model
		$this->setIdentifier($model->{$primaryKey});

		// Field post update
		foreach ($mapper->getFields() as $field) {
			$field->postUpdate($this->getInput());
		}

		// Model after create hook
		if (method_exists($admin, 'afterCreate')) {
			$result = $admin->afterCreate($this->getInput());

			if ($result instanceof \Illuminate\Http\RedirectResponse) {
				$result->send();
			}
		}

		return $this;
	}
991436
public function postUpdate($input)
	{
		$baseModel = $this->getAdmin()->getModel();
		$baseModel = $baseModel::find($this->getAdmin()->getFormBuilder()->getIdentifier());

		$morphType = $baseModel->{$this->getName()}()->getMorphType();
		$morphType = str_replace(sprintf('%s.', $this->getName()), '', $morphType);

		$foreignKey = $baseModel->{$this->getName()}()->getForeignKey();
		$foreignKey = str_replace(sprintf('%s.', $this->getName()), '', $foreignKey);

		// remove old polymorphic relations
		foreach ($baseModel->{$this->getName()} as $item) {
			$item->update([
				$foreignKey => 0,
				$morphType  => '',
			]);
		}

		// update new item with polymorphic relation
		$baseModel->{$this->getName()}()
			->getRelated()
			->where($items->getKeyName(), $input[$this->getName()])
			->update([
				$foreignKey => $this->getAdmin()->getFormBuilder()->getIdentifier(),
				$morphType  => get_class($baseModel),
			]);
	}
278207
protected function validateAttribute($object, $attribute)
    {
        $method = $this->method;
        $object->{$method}($attribute, $this->params);
    }