Creates an instance of ObjectStateGroup object from provided $input struct.

@param \eZ\Publish\SPI\Persistence\Content\ObjectState\InputStruct $input

@return \eZ\Publish\SPI\Persistence\Content\ObjectState\Group
328568
public function createObjectStateGroupFromInputStruct(InputStruct $input)
    {
        $objectStateGroup = new Group();

        $objectStateGroup->identifier = $input->identifier;
        $objectStateGroup->defaultLanguage = $input->defaultLanguage;
        $objectStateGroup->name = $input->name;
        $objectStateGroup->description = $input->description;

        $objectStateGroup->languageCodes = array();
        foreach ($input->name as $languageCode => $name) {
            $objectStateGroup->languageCodes[] = $languageCode;
        }

        return $objectStateGroup;
    }
942277
public static function fromObject($input, $group = NULL, $object = NULL)
	{
		$input = (array)$input;

		if (!isset(self::$groups[$group])) {
			throw new \InvalidArgumentException('Group \'' . $group . '\' not supported for ' . 'Skrz\\Meta\\Fixtures\\Protobuf\\ClassWithNoProperty' . '.');
		} else {
			$id = self::$groups[$group];
		}

		if ($object === null) {
			$object = new ClassWithNoProperty();
		} elseif (!($object instanceof ClassWithNoProperty)) {
			throw new \InvalidArgumentException('You have to pass object of class Skrz\Meta\Fixtures\Protobuf\ClassWithNoProperty.');
		}

		return $object;
	}
418790
public function parse(Input $input)
    {
        // fill config
        $this->config = $this->default;

        if ($input instanceof RequestInput) {
            $this->config['optional_item_id'] = true;
        }

        $object = $input->getAsObject();

        $document = $this->getFactory()->make(
            'Document',
            [$object, $this, new RootAccessable]
        );

        // Clear config
        $this->config = [];

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

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

        return $obj;
    }
745490
public static function jsonDecode($input)
    {
        $object = json_decode($input);

        if ($object === null && $input !== 'null') {
            throw new DomainException('Null result with non-null input');
        }

        return $object;
    }
36453
public static function fromProtobuf($input, $object = NULL, &$start = 0, $end = NULL)
	{
		if ($object === null) {
			$object = new ClassWithNoProperty();
		}

		if ($end === null) {
			$end = strlen($input);
		}

		while ($start < $end) {
			$tag = Binary::decodeVarint($input, $start);
			$wireType = $tag & 0x7;
			$number = $tag >> 3;
			switch ($number) {
				default:
					switch ($wireType) {
						case 0:
							Binary::decodeVarint($input, $start);
							break;
						case 1:
							$start += 8;
							break;
						case 2:
							$start += Binary::decodeVarint($input, $start);
							break;
						case 5:
							$start += 4;
							break;
						default:
							throw new ProtobufException('Unexpected wire type ' . $wireType . '.', $number);
					}
			}
		}

		return $object;
	}
123783
public function execute(Input $input): Input
    {

        if (!$input->isEvaluableForTypes(...$this->types)) {
            return $input;
        }

        return $this->resolve($input);
    }
167990
public function mtDisplay($input)
    {
        $modal = new MaterializeDisplayBuilder();

        $modal = $this->modalDirector->build(null, null, $input, null, $modal);

        return $modal->modalHead.$modal->modalBody.$modal->modalFooter;
    }
51787
public function setHtml($input): self {
        $this->manipulateNodesWithInput($input, function($node, $newNodes) {
            // Remove old contents from the current node.
            $node->contents()->remove();

            // Add new contents in it's place.
            $node->append($newNodes);
        });

        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),
			]);
	}
743493
protected function inputAsFirstNode($input): ?\DOMNode {
        $nodes = $this->inputAsNodeList($input);

        return $nodes->findXPath('self::*')->first();
    }
1056729
public function wrapAll($input): self {
        if (!$this->collection()->count()) {
            return $this;
        }

        if (is_callable($input)) {
            $input = $input($this->collection()->first());
        }

        $inputNode = $this->inputAsFirstNode($input);

        if (!($inputNode instanceof Element)) {
            return $this;
        }

        $stackNodes = $this->_prepareWrapStack($inputNode);

        // Add the new bottom (root) node before the first matched node
        $this->collection()->first()->before($stackNodes->bottom());

        $this->collection()->each(function($node) use ($stackNodes) {
            // Detach and add node back inside the new wrappers top (leaf) node.
            $stackNodes->top()->append($node->detach());
        });

        return $this;
    }
767757
public static function typed(string $type, iterable $input = []): Map
    {
        $resolver = Resolver::typed($type);

        return new static($input, $resolver);
    }
614876
public function send($input)
    {
        if (stripos(strrev($input), PHP_EOL) === false) {
            $input = $input . PHP_EOL;
        }

        $this->steps[] = [self::SEND, $input];

        return $this;
    }
39452
protected function inputAsNodeList($input, $cloneForManipulate = true): NodeList {
        $nodes = $this->inputPrepareAsTraversable($input);

        $newNodes = $this->newNodeList();

        foreach ($nodes as $node) {
            if ($node->document() !== $this->document()) {
                 $node = $this->document()->importNode($node, true);
            }

            if ($cloneForManipulate && $node->parentNode !== null) {
                $node = $node->cloneNode(true);
            }

            $newNodes[] = $node;
        }

        return $newNodes;
    }
208161
public function setInput($input)
    {
        if (!(is_string($input) || $input instanceof BasicFormElement)) {
            throw new Exception('Input must be a String or instance of FormElement Contract');
        }

        if (is_string($input)) {
            $input = $this->makeInput($input);
        }

        $this->input = $input;

        return $this;
    }
471502
public static function fromArray(array $input) {
        $input = array_map(function($value) {
            return is_array($value) ? ArrayObject::fromArray($value) : $value;
        }, $input);

        return new ArrayObject($input);
    }