3declare(strict_types=1);
11 abstract public static function getCollectionElementClass(): string;
15 [$property, $operation] = $this->getPropertyAndOperationWithType(
$name);
17 if ($operation ===
'get')
19 return $this->callGetMethod($property);
22 if ($operation ===
'set')
24 return $this->callSetMethod($property, $args);
30 private function getPropertyAndOperationWithType(
string $name):
array
32 $property = lcfirst(substr(
$name, 3));
33 $operation = substr(
$name, 0, 3);
34 $isList = lcfirst(substr($property, -4)) ===
'list';
35 $property = $isList ? substr($property, 0, -4) : $property;
37 return [$property, $operation];
40 private function callGetMethod(
string $property): ?
array
42 $getter =
'get' . $property;
43 if (!method_exists(self::getCollectionElementClass(), $getter))
49 foreach ($this as $item)
53 $data[] = $item->$getter();
64 private function callSetMethod(
string $property,
array $args): self
66 $setter =
'set' . $property;
67 if (!method_exists(self::getCollectionElementClass(), $setter))
72 foreach ($this as $item)
76 $item->$setter(...$args);
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
__call(string $name, array $args=[])