Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
- added property `priceCustomerGroupAssignments` to type `ProductSearchProjectionParams`
- added property `businessUnit` to type `ShoppingList`
- added property `businessUnit` to type `ShoppingListDraft`
- added property `published` to type `ShoppingListLineItem`
- added property `events` to type `Subscription`
- added property `events` to type `SubscriptionDraft`
</details>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ interface ShoppingListLineItem extends JsonObject
public const FIELD_NAME = 'name';
public const FIELD_PRODUCT_ID = 'productId';
public const FIELD_PRODUCT_TYPE = 'productType';
public const FIELD_PUBLISHED = 'published';
public const FIELD_QUANTITY = 'quantity';
public const FIELD_VARIANT_ID = 'variantId';
public const FIELD_VARIANT = 'variant';
Expand Down Expand Up @@ -97,6 +98,15 @@ public function getProductId();
*/
public function getProductType();

/**
* <p>Whether the related <a href="ctp:api:type:Product">Product</a> is published or not.</p>
* <p>This data is updated in an <a href="/general-concepts#eventual-consistency">eventual consistent manner</a> when the Product's published status changes.</p>
*

* @return null|bool
*/
public function getPublished();

/**
* <p>Number of Products in the ShoppingListLineItem.</p>
*
Expand Down Expand Up @@ -171,6 +181,11 @@ public function setProductId(?string $productId): void;
*/
public function setProductType(?ProductTypeReference $productType): void;

/**
* @param ?bool $published
*/
public function setPublished(?bool $published): void;

/**
* @param ?int $quantity
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@
*/
private $productType;

/**

* @var ?bool
*/
private $published;

/**

* @var ?int
Expand Down Expand Up @@ -191,6 +197,18 @@
return $this->productType instanceof ProductTypeReferenceBuilder ? $this->productType->build() : $this->productType;
}

/**
* <p>Whether the related <a href="ctp:api:type:Product">Product</a> is published or not.</p>
* <p>This data is updated in an <a href="/general-concepts#eventual-consistency">eventual consistent manner</a> when the Product's published status changes.</p>
*

* @return null|bool
*/
public function getPublished()

Check warning on line 207 in lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemBuilder.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemBuilder.php#L207

Added line #L207 was not covered by tests
{
return $this->published;

Check warning on line 209 in lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemBuilder.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemBuilder.php#L209

Added line #L209 was not covered by tests
}

/**
* <p>Number of Products in the ShoppingListLineItem.</p>
*
Expand Down Expand Up @@ -325,6 +343,17 @@
return $this;
}

/**
* @param ?bool $published
* @return $this
*/
public function withPublished(?bool $published)

Check warning on line 350 in lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemBuilder.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemBuilder.php#L350

Added line #L350 was not covered by tests
{
$this->published = $published;

Check warning on line 352 in lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemBuilder.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemBuilder.php#L352

Added line #L352 was not covered by tests

return $this;

Check warning on line 354 in lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemBuilder.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemBuilder.php#L354

Added line #L354 was not covered by tests
}

/**
* @param ?int $quantity
* @return $this
Expand Down Expand Up @@ -435,6 +464,7 @@
$this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name,
$this->productId,
$this->productType instanceof ProductTypeReferenceBuilder ? $this->productType->build() : $this->productType,
$this->published,

Check warning on line 467 in lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemBuilder.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemBuilder.php#L467

Added line #L467 was not covered by tests
$this->quantity,
$this->variantId,
$this->variant instanceof ProductVariantBuilder ? $this->variant->build() : $this->variant,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@
*/
protected $productType;

/**
*
* @var ?bool
*/
protected $published;

/**
*
* @var ?int
Expand Down Expand Up @@ -113,6 +119,7 @@
?LocalizedString $name = null,
?string $productId = null,
?ProductTypeReference $productType = null,
?bool $published = null,
?int $quantity = null,
?int $variantId = null,
?ProductVariant $variant = null,
Expand All @@ -126,6 +133,7 @@
$this->name = $name;
$this->productId = $productId;
$this->productType = $productType;
$this->published = $published;

Check warning on line 136 in lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php#L136

Added line #L136 was not covered by tests
$this->quantity = $quantity;
$this->variantId = $variantId;
$this->variant = $variant;
Expand Down Expand Up @@ -305,6 +313,27 @@
return $this->productType;
}

/**
* <p>Whether the related <a href="ctp:api:type:Product">Product</a> is published or not.</p>
* <p>This data is updated in an <a href="/general-concepts#eventual-consistency">eventual consistent manner</a> when the Product's published status changes.</p>
*
*
* @return null|bool
*/
public function getPublished()

Check warning on line 323 in lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php#L323

Added line #L323 was not covered by tests
{
if (is_null($this->published)) {

Check warning on line 325 in lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php#L325

Added line #L325 was not covered by tests
/** @psalm-var ?bool $data */
$data = $this->raw(self::FIELD_PUBLISHED);
if (is_null($data)) {
return null;

Check warning on line 329 in lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php#L327-L329

Added lines #L327 - L329 were not covered by tests
}
$this->published = (bool) $data;

Check warning on line 331 in lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php#L331

Added line #L331 was not covered by tests
}

return $this->published;

Check warning on line 334 in lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php#L334

Added line #L334 was not covered by tests
}

/**
* <p>Number of Products in the ShoppingListLineItem.</p>
*
Expand Down Expand Up @@ -454,6 +483,14 @@
$this->productType = $productType;
}

/**
* @param ?bool $published
*/
public function setPublished(?bool $published): void

Check warning on line 489 in lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php#L489

Added line #L489 was not covered by tests
{
$this->published = $published;

Check warning on line 491 in lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php#L491

Added line #L491 was not covered by tests
}

/**
* @param ?int $quantity
*/
Expand Down
1 change: 1 addition & 0 deletions references.txt
Original file line number Diff line number Diff line change
Expand Up @@ -404,3 +404,4 @@ f0288f95a5fe33fd2973df3f8290defb15129192
178cffb2a2cf988d054f8e346aae35f20a517e6b
761762c7caad45bc86b08db7021a033fff18ba90
b32dd9c6633745d71fb526473fed6cc60e1fab0a
dec65e707130185745930bde27ce78ae64ab29c1