67 $fields = $this->fieldsetConfig->getFieldset($fieldset, $root);
71 $targetIsArray = is_array(
$target);
74 if (empty($node[$aspect])) {
80 $targetCode = (string)$node[$aspect];
81 $targetCode = $targetCode ==
'*' ?
$code : $targetCode;
104 $eventName = sprintf(
'core_copy_fieldset_%s_%s', $fieldset, $aspect);
105 if ($targetIsArray) {
108 $this->eventManager->dispatch(
112 if ($targetIsArray) {
135 $fields = $this->fieldsetConfig->getFieldset($fieldset, $root);
142 if (empty($node[$aspect])) {
148 $targetCode = (string)$node[$aspect];
149 $targetCode = $targetCode ==
'*' ?
$code : $targetCode;
166 $source instanceof \
Magento\Framework\Api\ExtensibleDataInterface ||
167 $source instanceof \
Magento\Framework\Api\AbstractSimpleObject) && (
168 is_array(
$target) ||
$target instanceof \Magento\Framework\DataObject ||
169 $target instanceof \Magento\Framework\Api\ExtensibleDataInterface ||
170 $target instanceof \Magento\Framework\Api\AbstractSimpleObject);
191 $sourceArray =
$source->__toArray();
194 throw new \InvalidArgumentException(
195 'Source should be array, Magento Object, ExtensibleDataInterface, or AbstractSimpleObject' 213 $targetIsArray = is_array(
$target);
215 if ($targetIsArray) {
224 throw new \InvalidArgumentException(
225 'Source should be array, Magento Object, ExtensibleDataInterface, or AbstractSimpleObject' 243 $method =
'get' . str_replace(
' ',
'', ucwords(str_replace(
'_',
' ',
$code)));
246 if ($methodExists ==
true) {
252 throw new \InvalidArgumentException(
'Method in extension does not exist.');
255 if ($extensionMethodExists ==
true) {
258 throw new \InvalidArgumentException(
'Attribute in object does not exist.');
277 $method =
'set' . str_replace(
' ',
'', ucwords(str_replace(
'_',
' ',
$code)));
280 if ($methodExists ==
true) {
289 if ($extensionMethodExists ==
true) {
293 throw new \InvalidArgumentException(
'Attribute in object does not exist.');
elseif(isset( $params[ 'redirect_parent']))
_isFieldsetInputValid($source, $target)
__construct(\Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\DataObject\Copy\Config $fieldsetConfig, \Magento\Framework\Api\ExtensionAttributesFactory $extensionAttributesFactory)
getAttributeValueFromExtensibleDataObject($source, $code)
setAttributeValueFromExtensibleDataObject($target, $code, $value)
copyFieldsetToTarget($fieldset, $aspect, $source, $target, $root='global')
dispatchCopyFieldSetEvent($fieldset, $aspect, $source, $target, $root, $targetIsArray)
_getFieldsetFieldValue($source, $code)
getDataFromFieldset($fieldset, $aspect, $source, $root='global')
$extensionAttributesFactory
_setFieldsetFieldValue($target, $targetCode, $value)