Skip to content

Commit

Permalink
Update ObjectSuperClass.php
Browse files Browse the repository at this point in the history
Added the methods to get list of names and labels.
  • Loading branch information
Ruslan Baidan authored Feb 3, 2023
1 parent fc8ca09 commit e6289d3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/Model/Entity/ObjectSuperClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,16 @@ public function getName(int $languageIndex): string
return (string)$this->{'name' . $languageIndex};
}

public function getNames(): array
{
return [
'name1' => $this->name1,
'name2' => $this->name2,
'name3' => $this->name3,
'name4' => $this->name4,
];
}

public function setLabel(string $labelKey, string $labelValue): self
{
if (in_array($labelKey, ['label1', 'label2', 'label3', 'label4'], true)) {
Expand All @@ -378,6 +388,16 @@ public function getLabel(int $languageIndex): string
return (string)$this->{'label' . $languageIndex};
}

public function getLabels(): array
{
return [
'label1' => $this->label1,
'label2' => $this->label2,
'label3' => $this->label3,
'label4' => $this->label4,
];
}

public function getScope(): int
{
return $this->scope;
Expand Down

0 comments on commit e6289d3

Please sign in to comment.