public function unserialize(array $searchCondition): SearchCondition
    {
        if (2 !== \count($searchCondition) || !isset($searchCondition[0], $searchCondition[1])) {
            throw new InvalidArgumentException(
                'Serialized search condition must be exactly two values [FieldSet-name, serialized ValuesGroup].'
            );
        }

        $fieldSet = $this->searchFactory->createFieldSet($searchCondition[0]);

        // FIXME This needs safe serialzing with error handling
        if (false === $group = unserialize($searchCondition[1])) {
            throw new InvalidArgumentException('Unable to unserialize invalid value.');
        }

        return new SearchCondition($fieldSet, $group);
    }
public function unserialize(array $searchCondition): SearchCondition
    {
        if (2 !== \count($searchCondition) || !isset($searchCondition[0], $searchCondition[1])) {
            throw new InvalidArgumentException(
                'Serialized search condition must be exactly two values [FieldSet-name, serialized ValuesGroup].'
            );
        }

        $fieldSet = $this->searchFactory->createFieldSet($searchCondition[0]);

        // FIXME This needs safe serialzing with error handling
        if (false === $group = unserialize($searchCondition[1])) {
            throw new InvalidArgumentException('Unable to unserialize invalid value.');
        }

        return new SearchCondition($fieldSet, $group);
    }
public function unserialize ( array $ searchCondition ) : SearchCondition { if ( 2 !== \ count ( $ searchCondition ) || ! isset ( $ searchCondition [ 0 ] , $ searchCondition [ 1 ] ) ) { throw new InvalidArgumentException ( 'Serialized search condition must be exactly two values [FieldSet-name, serialized ValuesGroup].' ) ; } $ fieldSet = $ this -> searchFactory -> createFieldSet ( $ searchCondition [ 0 ] ) ; // FIXME This needs safe serialzing with error handling if ( false === $ group = unserialize ( $ searchCondition [ 1 ] ) ) { throw new InvalidArgumentException ( 'Unable to unserialize invalid value.' ) ; } return new SearchCondition ( $ fieldSet , $ group ) ; }
Unserialize a serialized SearchCondition.

@param array $searchCondition [FieldSet-name, serialized ValuesGroup object]

@throws InvalidArgumentException when serialized SearchCondition is invalid
(invalid structure or failed to unserialize)
Unserialize a serialized SearchCondition .