|
|
@@ -54,6 +54,7 @@ use App\Filter\ApiPlatform\Person\FullNameFilter;
|
|
|
use App\Filter\ApiPlatform\Utils\InFilter;
|
|
|
use App\Repository\Access\AccessRepository;
|
|
|
// use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
|
|
|
+use App\Entity\Access\AccessPreference;
|
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
|
use Doctrine\Common\Collections\Collection;
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
@@ -300,6 +301,9 @@ class Access implements UserInterface, PasswordAuthenticatedUserInterface
|
|
|
#[ORM\InverseJoinColumn(name: 'tag_id', referencedColumnName: 'id')]
|
|
|
private Collection $tags;
|
|
|
|
|
|
+ #[ORM\OneToOne(mappedBy: 'access', cascade: ['persist'], fetch: 'EAGER', orphanRemoval: true)]
|
|
|
+ private ?AccessPreference $preferences;
|
|
|
+
|
|
|
#[Pure]
|
|
|
public function __construct()
|
|
|
{
|
|
|
@@ -2138,4 +2142,19 @@ class Access implements UserInterface, PasswordAuthenticatedUserInterface
|
|
|
|
|
|
return $this;
|
|
|
}
|
|
|
+
|
|
|
+ public function setPreferences(AccessPreference $preferences = null)
|
|
|
+ {
|
|
|
+ if(!is_null($preferences)){
|
|
|
+ $preferences->setAccess($this);
|
|
|
+ }
|
|
|
+ $this->preferences = $preferences;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getPreferences()
|
|
|
+ {
|
|
|
+ return $this->preferences;
|
|
|
+ }
|
|
|
}
|