src/Blackprism/Serializer/Json/Deserialize.php
private function setObject(array $data)
    {
        $identifierAttribute = $this->configuration->getIdentifierAttribute();

        if ($identifierAttribute === null) {
            throw new UndefinedIdentifierAttribute();
        }

        // We found an identifier attribute, $data is a json object
        if (isset($data[$identifierAttribute]) === true) {
            return $this->setObjectForObjectData($identifierAttribute, $data);
        }

        // We don't found an identifier attribute, $data is a collection
        return $this->setObjectForCollectionData($data);
    }
private function setObject(array $data)
    {
        $identifierAttribute = $this->configuration->getIdentifierAttribute();

        if ($identifierAttribute === null) {
            throw new UndefinedIdentifierAttribute();
        }

        // We found an identifier attribute, $data is a json object
        if (isset($data[$identifierAttribute]) === true) {
            return $this->setObjectForObjectData($identifierAttribute, $data);
        }

        // We don't found an identifier attribute, $data is a collection
        return $this->setObjectForCollectionData($data);
    }
private function setObject ( array $ data ) { $ identifierAttribute = $ this -> configuration -> getIdentifierAttribute ( ) ; if ( $ identifierAttribute === null ) { throw new UndefinedIdentifierAttribute ( ) ; } // We found an identifier attribute, $data is a json object if ( isset ( $ data [ $ identifierAttribute ] ) === true ) { return $ this -> setObjectForObjectData ( $ identifierAttribute , $ data ) ; } // We don't found an identifier attribute, $data is a collection return $ this -> setObjectForCollectionData ( $ data ) ; }
Create class object with data

@param mixed[] $data

@return object|object[]
@throws UndefinedIdentifierAttribute
@throws MissingIdentifierAttribute
Create class object with data