|null * @readonly */ public $joinColumns; /** * The join column that is being mapped to the persistent attribute. * * @var array|null * @readonly */ public $inverseJoinColumns; /** * The join table that maps the relationship. * * @var JoinTable|null * @readonly */ public $joinTable; /** * The name of the association-field on the inverse-side. * * @var string|null * @readonly */ public $inversedBy; /** * The fetching strategy to use for the association. * * @var string|null * @psalm-var 'LAZY'|'EAGER'|'EXTRA_LAZY'|null * @readonly * @Enum({"LAZY", "EAGER", "EXTRA_LAZY"}) */ public $fetch; /** * @param JoinColumn|array $joinColumns * @param JoinColumn|array $inverseJoinColumns * @psalm-param 'LAZY'|'EAGER'|'EXTRA_LAZY'|null $fetch */ public function __construct( string $name, $joinColumns = null, $inverseJoinColumns = null, ?JoinTable $joinTable = null, ?string $inversedBy = null, ?string $fetch = null ) { if ($joinColumns instanceof JoinColumn) { $joinColumns = [$joinColumns]; } if ($inverseJoinColumns instanceof JoinColumn) { $inverseJoinColumns = [$inverseJoinColumns]; } $this->name = $name; $this->joinColumns = $joinColumns; $this->inverseJoinColumns = $inverseJoinColumns; $this->joinTable = $joinTable; $this->inversedBy = $inversedBy; $this->fetch = $fetch; } }