protected function makeClearedDataObject($objectClass, array $data, $parentKey = null)
    {
        /** @var AbstractDataObject $object */
        $object = new $objectClass();
        $object->clear();

        try {
            $object->setAttributes($data);

        } catch (ModelConfigurationDataException $e) {

            throw $e->setDotKey(
                $parentKey . ($e->getDotKey() ? '.' . $e->getDotKey() : null)
            );
        }

        return $object;
    }
protected function makeClearedDataObject($objectClass, array $data, $parentKey = null)
    {
        /** @var AbstractDataObject $object */
        $object = new $objectClass();
        $object->clear();

        try {
            $object->setAttributes($data);

        } catch (ModelConfigurationDataException $e) {

            throw $e->setDotKey(
                $parentKey . ($e->getDotKey() ? '.' . $e->getDotKey() : null)
            );
        }

        return $object;
    }
protected function makeClearedDataObject ( $ objectClass , array $ data , $ parentKey = null ) { /** @var AbstractDataObject $object */ $ object = new $ objectClass ( ) ; $ object -> clear ( ) ; try { $ object -> setAttributes ( $ data ) ; } catch ( ModelConfigurationDataException $ e ) { throw $ e -> setDotKey ( $ parentKey . ( $ e -> getDotKey ( ) ? '.' . $ e -> getDotKey ( ) : null ) ) ; } return $ object ; }
Makes a fresh dataobject with its defaults cleared before filling it with data.

@param string      $objectClass
@param array       $data
@param null|string $parentKey
@return AbstractDataObject
@throws ModelConfigurationDataException
Makes a fresh dataobject with its defaults cleared before filling it with data .