File tree Expand file tree Collapse file tree 3 files changed +19
-5
lines changed
Expand file tree Collapse file tree 3 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ class UpsertTypedSearchAttributes extends Request
1313 public const NAME = 'UpsertWorkflowTypedSearchAttributes ' ;
1414
1515 /**
16- * @param list< SearchAttributeUpdate> $searchAttributes
16+ * @param array<array-key, SearchAttributeUpdate> $searchAttributes
1717 */
1818 public function __construct (
1919 private readonly array $ searchAttributes ,
@@ -22,7 +22,7 @@ public function __construct(
2222 }
2323
2424 /**
25- * @return list< SearchAttributeUpdate>
25+ * @return array<array-key, SearchAttributeUpdate>
2626 */
2727 public function getSearchAttributes (): array
2828 {
Original file line number Diff line number Diff line change @@ -113,9 +113,7 @@ public function upsertSearchAttributes(array $searchAttributes): void
113113
114114 public function upsertTypedSearchAttributes (SearchAttributeUpdate ...$ updates ): void
115115 {
116- $ this ->request (
117- new UpsertTypedSearchAttributes ($ updates ),
118- );
116+ $ this ->request (new UpsertTypedSearchAttributes ($ updates ));
119117 }
120118
121119 #[\Override]
Original file line number Diff line number Diff line change 1616use Temporal \Activity \ActivityOptions ;
1717use Temporal \Activity \ActivityOptionsInterface ;
1818use Temporal \Client \WorkflowStubInterface ;
19+ use Temporal \Common \SearchAttributes \SearchAttributeUpdate ;
1920use Temporal \DataConverter \Type ;
2021use Temporal \DataConverter \ValuesInterface ;
2122use Temporal \Exception \OutOfContextException ;
@@ -911,6 +912,21 @@ public static function upsertSearchAttributes(array $searchAttributes): void
911912 self ::getCurrentContext ()->upsertSearchAttributes ($ searchAttributes );
912913 }
913914
915+ /**
916+ * Upsert typed Search Attributes
917+ *
918+ * ```php
919+ * Workflow::upsertTypedSearchAttributes(
920+ * SearchAttributeKey::forKeyword('CustomKeyword')->valueSet('CustomValue'),
921+ * SearchAttributeKey::forInt('MyCounter')->valueSet(42),
922+ * );
923+ * ```
924+ */
925+ public static function upsertTypedSearchAttributes (SearchAttributeUpdate ...$ updates ): void
926+ {
927+ self ::getCurrentContext ()->upsertTypedSearchAttributes (...$ updates );
928+ }
929+
914930 /**
915931 * Generate a UUID.
916932 *
You can’t perform that action at this time.
0 commit comments