src/Entity/Channel/Drive.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Channel;
  3. use App\Repository\Channel\DriveRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Nellapp\Bundle\SDKBundle\Drive\Entity\DriveInterface;
  8. use Nellapp\Bundle\SDKBundle\Drive\Entity\DriveTrait;
  9. use Symfony\Component\Uid\Uuid;
  10. #[ORM\Entity(repositoryClassDriveRepository::class)]
  11. class Drive implements DriveInterface
  12. {
  13.     use DriveTrait;
  14.     #[ORM\Id,
  15.         ORM\GeneratedValue(strategy'NONE'),
  16.         ORM\Column(type'string'length36)]
  17.     private ?string $id null;
  18.     #[ORM\OneToMany(mappedBy'drive'targetEntityDriveFile::class)]
  19.     private Collection $files;
  20.     #[ORM\ManyToOne(inversedBy'drives')]
  21.     private ?Channel $channel null;
  22.     #[ORM\Column(length255)]
  23.     private ?string $type null;
  24.     public function __construct(Channel $channel)
  25.     {
  26.         $this->id Uuid::v4()->toRfc4122();
  27.         $this->channel $channel;
  28.         $this->files = new ArrayCollection();
  29.     }
  30. }