web-base/Core/Objects/DatabaseEntity/Attribute/MultipleReference.class.php

32 lines
889 B
PHP
Raw Normal View History

2023-01-10 22:12:05 +01:00
<?php
namespace Core\Objects\DatabaseEntity\Attribute;
// Managed NM table, e.g. #[MultipleReference(Y::class, "x", "z")] in X::class will use
// the table of Y::class and lookup values by column "x_id" and create an array with keys of "z_id" holding a reference of Y
2023-01-10 22:12:05 +01:00
#[\Attribute(\Attribute::TARGET_PROPERTY)]
class MultipleReference {
private string $className;
private string $thisProperty;
private string $relProperty;
public function __construct(string $className, string $thisProperty, string $relProperty) {
$this->className = $className;
$this->thisProperty = $thisProperty;
$this->relProperty = $relProperty;
}
public function getClassName(): string {
return $this->className;
}
public function getThisProperty(): string {
return $this->thisProperty;
}
public function getRelProperty(): string {
return $this->relProperty;
}
}