<?php
namespace Products\NotificationsBundle\Entity;
use Cms\CoreBundle\Model\Interfaces\OneRosterable\OneRosterableInterface;
use Cms\CoreBundle\Model\Interfaces\OneRosterable\OneRosterableTrait;
use Cms\TenantBundle\Entity\TenantedEntity;
use Doctrine\ORM\Mapping as ORM;
/**
* Class ProfileRelationship
* @package Products\NotificationsBundle\Entity
*
* @ORM\Entity(
* repositoryClass = "Products\NotificationsBundle\Doctrine\Repository\ProfileRelationshipRepository",
* )
* @ORM\Table(
* name = "notis__profile_relationship",
* )
*/
class ProfileRelationship extends TenantedEntity implements OneRosterableInterface
{
use OneRosterableTrait;
/**
* @var Profile|null
*
* @ORM\ManyToOne(
* targetEntity = "Products\NotificationsBundle\Entity\Profile",
* inversedBy = "relationships",
* )
* @ORM\JoinColumn(
* name = "profile",
* referencedColumnName = "id",
* nullable = true,
* onDelete = "CASCADE",
* )
*/
protected ?Profile $profile = null;
/**
* @var Student|null
*
* @ORM\ManyToOne(
* targetEntity = "Products\NotificationsBundle\Entity\Student",
* inversedBy = "relationships",
* )
* @ORM\JoinColumn(
* name = "student",
* referencedColumnName = "id",
* nullable = true,
* onDelete = "CASCADE",
* )
*/
protected ?Student $student = null;
/**
* @var array|null
*
* @ORM\Column(
* type = "json",
* nullable = true,
* )
*/
protected ?array $metadata = [];
/**
* @return Profile|null
*/
public function getProfile(): ?Profile
{
return $this->profile;
}
/**
* @param Profile $profile
* @return $this
*/
public function setProfile(Profile $profile): self
{
$this->profile = $profile;
return $this;
}
/**
* @return Student|null
*/
public function getStudent(): ?Student
{
return $this->student;
}
/**
* @param Student $student
* @return $this
*/
public function setStudent(Student $student): self
{
$this->student = $student;
return $this;
}
/**
* @return array
*/
public function getMetadata(): array
{
return $this->metadata ?? [];
}
/**
* @param array|null $metadata
* @return $this
*/
public function setMetadata(?array $metadata): self
{
$this->metadata = $metadata ?: null;
return $this;
}
}