@@ -121,34 +121,34 @@ |
||
121 | 121 | return $manager->searchItems( $search ); |
122 | 122 | } |
123 | 123 | |
124 | - /** |
|
125 | - * Saves and returns the new or updated item |
|
126 | - * |
|
127 | - * @param \Aimeos\MShop\Common\Manager\Iface $manager Manager responsible for the items |
|
128 | - * @param \stdClass $entry Object including "id" and "attributes" elements |
|
129 | - * @return \Aimeos\MShop\Common\Item\Iface New or updated item |
|
130 | - */ |
|
131 | - protected function saveEntry( \Aimeos\MShop\Common\Manager\Iface $manager, \stdClass $entry ) : \Aimeos\MShop\Common\Item\Iface |
|
132 | - { |
|
133 | - if( isset( $entry->id ) ) { |
|
134 | - $item = $manager->getItem( $entry->id ); |
|
135 | - } else { |
|
136 | - $item = $manager->createItem(); |
|
137 | - } |
|
124 | + /** |
|
125 | + * Saves and returns the new or updated item |
|
126 | + * |
|
127 | + * @param \Aimeos\MShop\Common\Manager\Iface $manager Manager responsible for the items |
|
128 | + * @param \stdClass $entry Object including "id" and "attributes" elements |
|
129 | + * @return \Aimeos\MShop\Common\Item\Iface New or updated item |
|
130 | + */ |
|
131 | + protected function saveEntry( \Aimeos\MShop\Common\Manager\Iface $manager, \stdClass $entry ) : \Aimeos\MShop\Common\Item\Iface |
|
132 | + { |
|
133 | + if( isset( $entry->id ) ) { |
|
134 | + $item = $manager->getItem( $entry->id ); |
|
135 | + } else { |
|
136 | + $item = $manager->createItem(); |
|
137 | + } |
|
138 | 138 | |
139 | - if( isset( $entry->attributes ) && ( $attr = (array) $entry->attributes ) ) { |
|
140 | - if(isset($attr["service.config"])) { |
|
141 | - $attr["service.config"] = (array) $attr["service.config"]; |
|
142 | - } |
|
143 | - $item = $item->fromArray( $attr, true ); |
|
144 | - } |
|
139 | + if( isset( $entry->attributes ) && ( $attr = (array) $entry->attributes ) ) { |
|
140 | + if(isset($attr["service.config"])) { |
|
141 | + $attr["service.config"] = (array) $attr["service.config"]; |
|
142 | + } |
|
143 | + $item = $item->fromArray( $attr, true ); |
|
144 | + } |
|
145 | 145 | |
146 | - $item = $manager->saveItem( $item ); |
|
146 | + $item = $manager->saveItem( $item ); |
|
147 | 147 | |
148 | - if( isset( $entry->relationships ) ) { |
|
149 | - $this->saveRelationships( $manager, $item, $entry->relationships ); |
|
150 | - } |
|
148 | + if( isset( $entry->relationships ) ) { |
|
149 | + $this->saveRelationships( $manager, $item, $entry->relationships ); |
|
150 | + } |
|
151 | 151 | |
152 | - return $manager->getItem( $item->getId() ); |
|
153 | - } |
|
152 | + return $manager->getItem( $item->getId() ); |
|
153 | + } |
|
154 | 154 | } |
@@ -137,7 +137,7 @@ |
||
137 | 137 | } |
138 | 138 | |
139 | 139 | if( isset( $entry->attributes ) && ( $attr = (array) $entry->attributes ) ) { |
140 | - if(isset($attr["service.config"])) { |
|
140 | + if( isset( $attr["service.config"] ) ) { |
|
141 | 141 | $attr["service.config"] = (array) $attr["service.config"]; |
142 | 142 | } |
143 | 143 | $item = $item->fromArray( $attr, true ); |