# Google Shopping Merchant DataSources V1beta Client - Class DefaultRule (2.0.0)

2.0.0 (latest) 1.3.1 1.2.1 1.1.1 1.0.0 0.6.0 0.5.1 0.4.0 0.3.1 0.2.3 0.1.0

> [!WARNING]
> **Beta**
>
>
> This library is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1)
> of the Terms of Service. Pre-GA libraries might have limited support,
> and changes to pre-GA libraries might not be compatible with other pre-GA versions.
> For more information, see the
> [launch stage descriptions](https://docs.cloud.google.com/products#product-launch-stages).

Reference documentation and code samples for the Google Shopping Merchant DataSources V1beta Client class DefaultRule.

Default rule management of the data source.

Generated from protobuf message `google.shopping.merchant.datasources.v1beta.PrimaryProductDataSource.DefaultRule`

## Namespace

Google \\ Shopping \\ Merchant \\ DataSources \\ V1beta \\ PrimaryProductDataSource

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ take_from_data_sources` | `array<https://docs.cloud.google.com/php/docs/reference/shopping-merchant-datasources/latest/V1beta.DataSourceReference>` Required. The list of data sources linked in the [default rule](https://support.google.com/merchants/answer/7450276). This list is ordered by the default rule priority of joining the data. It might include none or multiple references to `self` and supplemental data sources. The list must not be empty. To link the data source to the default rule, you need to add a new reference to this list (in sequential order). To unlink the data source from the default rule, you need to remove the given reference from this list. Changing the order of this list will result in changing the priority of data sources in the default rule. For example, providing the following list: \[`1001`, `self`\] will take attribute values from supplemental data source `1001`, and fallback to `self` if the attribute is not set in `1001`. |

### getTakeFromDataSources

Required. The list of data sources linked in the [default
rule](https://support.google.com/merchants/answer/7450276).

This list is ordered by the default rule priority of joining the data.
It might include none or multiple references to `self` and supplemental
data sources.
The list must not be empty.
To link the data source to the default rule, you need to add a
new reference to this list (in sequential order).
To unlink the data source from the default rule, you need to
remove the given reference from this list.
Changing the order of this list will result in changing the priority of
data sources in the default rule.
For example, providing the following list: \[`1001`, `self`\] will
take attribute values from supplemental data source `1001`, and fallback
to `self` if the attribute is not set in `1001`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/RepeatedField` |   |

### setTakeFromDataSources

Required. The list of data sources linked in the [default
rule](https://support.google.com/merchants/answer/7450276).

This list is ordered by the default rule priority of joining the data.
It might include none or multiple references to `self` and supplemental
data sources.
The list must not be empty.
To link the data source to the default rule, you need to add a
new reference to this list (in sequential order).
To unlink the data source from the default rule, you need to
remove the given reference from this list.
Changing the order of this list will result in changing the priority of
data sources in the default rule.
For example, providing the following list: \[`1001`, `self`\] will
take attribute values from supplemental data source `1001`, and fallback
to `self` if the attribute is not set in `1001`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/shopping-merchant-datasources/latest/V1beta.DataSourceReference>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |