4
0

update 2023-08-02 13:55:03

This commit is contained in:
Robot 2023-08-02 13:55:03 +02:00
parent bdd414c22f
commit d54443de20
Signed by: Robot
GPG Key ID: 14DECD44E7E1BB95
3 changed files with 8 additions and 6 deletions

View File

@ -19,7 +19,7 @@ class Tag << (F,LightGreen) >> #Green {
+ create(string $name, ?string $description) : ?array + create(string $name, ?string $description) : ?array
+ update(string $tag, string $name, ...) : ?array + update(string $tag, string $name, ...) : ?array
+ delete(string $tag) : ?array + delete(string $tag) : ?array
- get(string $linker, string $name) : ?array - get(string $linker, string $name) : ?object
- createTag(string $linker, string $name, ...) : bool - createTag(string $linker, string $name, ...) : bool
} }
@ -65,7 +65,7 @@ note right of Tag::get
Get a tag Get a tag
since: 2.0.1 since: 2.0.1
return: ?array return: ?object
end note end note
note right of Tag::createTag note right of Tag::createTag

View File

@ -173,6 +173,7 @@ final class Tag
// update the description if it does not match // update the description if it does not match
$description = $description ?? ''; $description = $description ?? '';
$description = trim($description); $description = trim($description);
$_tag->description = $_tag->description ?? '';
if ($_tag->description !== $description && $this->update->value($description, 'description', $_tag->id, 'id', 'tag')) if ($_tag->description !== $description && $this->update->value($description, 'description', $_tag->id, 'id', 'tag'))
{ {
$_tag->description = $description; $_tag->description = $description;
@ -237,13 +238,13 @@ final class Tag
* @param string $linker The linker GUID value * @param string $linker The linker GUID value
* @param string $name The tag name * @param string $name The tag name
* *
* @return array|null Array of the tagged verse values on success * @return object|null Array of the tagged verse values on success
* @since 2.0.1 * @since 2.0.1
**/ **/
private function get( private function get(
string $linker, string $linker,
string $name string $name
): ?array ): ?object
{ {
// get tag if it exist // get tag if it exist
if (($tag = $this->load->item([ if (($tag = $this->load->item([

View File

@ -144,6 +144,7 @@
// update the description if it does not match // update the description if it does not match
$description = $description ?? ''; $description = $description ?? '';
$description = trim($description); $description = trim($description);
$_tag->description = $_tag->description ?? '';
if ($_tag->description !== $description && $this->update->value($description, 'description', $_tag->id, 'id', 'tag')) if ($_tag->description !== $description && $this->update->value($description, 'description', $_tag->id, 'id', 'tag'))
{ {
$_tag->description = $description; $_tag->description = $description;
@ -208,13 +209,13 @@
* @param string $linker The linker GUID value * @param string $linker The linker GUID value
* @param string $name The tag name * @param string $name The tag name
* *
* @return array|null Array of the tagged verse values on success * @return object|null Array of the tagged verse values on success
* @since 2.0.1 * @since 2.0.1
**/ **/
private function get( private function get(
string $linker, string $linker,
string $name string $name
): ?array ): ?object
{ {
// get tag if it exist // get tag if it exist
if (($tag = $this->load->item([ if (($tag = $this->load->item([