A
A
andrei selderei2015-04-24 10:14:01
PHP
andrei selderei, 2015-04-24 10:14:01

How to assign values ​​to a property of an object with this structure?

object -> $product. Its print_r :

....
 [cache_default_attribute] => 
    [category] => 
    [webserviceParameters:protected] => Array
        (
            [objectMethods] => Array
                (
                    [add] => addWs
                    [update] => updateWs
                )

            [objectNodeNames] => products
            [fields] => Array
                (
                    [id_manufacturer] => Array
                        (
                            [xlink_resource] => manufacturers
                        )

                    [id_supplier] => Array
                        (
                            [xlink_resource] => suppliers
                        )

                    [id_category_default] => Array
                        (
                            [xlink_resource] => categories
                        )

                    [new] => Array
                        (
                        )

                    [cache_default_attribute] => Array
                        (
                        )

                    [id_default_image] => Array
                        (
                            [getter] => getCoverWs
                            [setter] => setCoverWs
                            [xlink_resource] => Array
                                (
                                    [resourceName] => images
                                    [subResourceName] => products
                                )

                        )

                    [id_default_combination] => Array
                        (
                            [getter] => getWsDefaultCombination
                            [setter] => setWsDefaultCombination
                            [xlink_resource] => Array
                                (
                                    [resourceName] => combinations
                                )

                        )

                    [id_tax_rules_group] => Array
                        (
                            [xlink_resource] => Array
                                (
                                    [resourceName] => tax_rule_groups
                                )

                        )

                    [position_in_category] => Array
                        (
                            [getter] => getWsPositionInCategory
                            [setter] => 
                        )

                    [manufacturer_name] => Array
                        (
                            [getter] => getWsManufacturerName
                            [setter] => 
                        )

                    [quantity] => Array
                        (
                            [getter] => 
                            [setter] => 
                        )

                    [type] => Array
                        (
                            [getter] => getWsType
                            [setter] => setWsType
                        )

                )

            [associations] => Array
                (
                    [categories] => Array
                        (
                            [resource] => category
                            [fields] => Array
                                (
                                    [id] => Array
                                        (
                                            [required] => 1
                                        )

                                )

                        )

                    [images] => Array
                        (
                            [resource] => image
                            [fields] => Array
                                (
                                    [id] => Array
                                        (
                                        )

                                )

                        )

                    [combinations] => Array
                        (
                            [resource] => combinations
                            [fields] => Array
                                (
                                    [id] => Array
                                        (
                                            [required] => 1
                                        )

                                )

                        )

                    [product_option_values] => Array
                        (
                            [resource] => product_options_values
                            [fields] => Array
                                (
                                    [id] => Array
                                        (
                                            [required] => 1
                                        )

                                )

                        )

                    [product_features] => Array
                        (
                            [resource] => product_feature
                            [fields] => Array
                                (
                                    [id] => Array
                                        (
                                            [required] => 1
                                        )

                                    [custom] => Array
                                        (
                                            [required] => 
                                        )

                                    [id_feature_value] => Array
                                        (
                                            [required] => 1
                                            [xlink_resource] => product_feature_values
                                        )

                                )

                        )
.....

I need to assign multiple values ​​to the [product_features] property, but I can't figure out how.
I suspect that it should look something like this:
$product->... = $znacheniya
But how to access this property and what format the array should have is not clear. help me please

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
andrei selderei, 2015-04-24
@acelash

Found a solution:
Product::addFeatureProductImport($id_product, $feat_id, $feat_value_id);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question