get a data set of contact tags through a mailing list#6
get a data set of contact tags through a mailing list#6scabudlan wants to merge 4 commits intoIdeneal:masterfrom
Conversation
src/Entity/Contact.php
Outdated
|
|
||
| public function addTag(string $key, string $value): self | ||
| { | ||
| $this->tags[$key] = $value; |
There was a problem hiding this comment.
As written in the official documentation this should be a simple array of strings and not a key => value array.
Could you please change it and add a check if the tag already exists?
There was a problem hiding this comment.
Sorry, I don't understand....why the value should be true or false if it's a string?
There was a problem hiding this comment.
Would be grateful to add a method to delete a tag, and related test cases 😄
There was a problem hiding this comment.
Hi, thank you for your time reviewing my pull request.
As requested, I have added the method removeTag and also updated the ContactSerializerTest.php.
|
|
||
| public function getTags(string $callerInfo="createContact"): array | ||
| { | ||
| $newTags = []; |
There was a problem hiding this comment.
Why don't you return the tags property?
| $json = [ | ||
| 'email_address' => $object->getEmail(), | ||
| 'fields' => $object->getFields(), | ||
| 'tags' => $object->getTags(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2)[1]['function']), |
| 'FirstName' => 'John', | ||
| 'LastName' => 'Doe', | ||
| ], | ||
| 'tags' => [ |
There was a problem hiding this comment.
Why the json tags should be like that (key: string => value: boolean)?

No description provided.