55use CodedMonkey \Dirigent \Doctrine \Repository \VersionRepository ;
66use Doctrine \Common \Collections \ArrayCollection ;
77use Doctrine \Common \Collections \Collection ;
8- use Doctrine \DBAL \Types \Types ;
98use Doctrine \ORM \Mapping as ORM ;
109
1110#[ORM \Entity(repositoryClass: VersionRepository::class)]
@@ -18,102 +17,21 @@ class Version extends TrackedEntity
1817 #[ORM \GeneratedValue]
1918 private ?int $ id = null ;
2019
21- #[ORM \Column]
22- protected string $ packageName ;
23-
2420 #[ORM \Column]
2521 private string $ name ;
2622
2723 #[ORM \Column(length: 191 )]
2824 private string $ normalizedName ;
2925
30- #[ORM \Column(type: Types::TEXT , nullable: true )]
31- protected ?string $ description = null ;
32-
33- #[ORM \Column(type: Types::TEXT , nullable: true )]
34- protected ?string $ readme = null ;
35-
36- #[ORM \Column(nullable: true )]
37- protected ?string $ homepage = null ;
38-
3926 #[ORM \Column]
4027 private bool $ development ;
4128
42- #[ORM \Column]
43- protected array $ license = [];
44-
45- #[ORM \Column(nullable: true )]
46- protected ?string $ type = null ;
47-
48- #[ORM \Column(nullable: true )]
49- protected ?string $ targetDir = null ;
50-
51- #[ORM \Column(nullable: true )]
52- protected ?array $ source = null ;
53-
54- #[ORM \Column(nullable: true )]
55- protected ?array $ dist = null ;
56-
57- #[ORM \OneToMany(mappedBy: 'version ' , targetEntity: VersionRequireLink::class, cascade: ['persist ' , 'detach ' , 'remove ' ])]
58- protected Collection $ require ;
59-
60- #[ORM \OneToMany(mappedBy: 'version ' , targetEntity: VersionDevRequireLink::class, cascade: ['persist ' , 'detach ' , 'remove ' ])]
61- protected Collection $ devRequire ;
62-
63- #[ORM \OneToMany(mappedBy: 'version ' , targetEntity: VersionConflictLink::class, cascade: ['persist ' , 'detach ' , 'remove ' ])]
64- protected Collection $ conflict ;
65-
66- #[ORM \OneToMany(mappedBy: 'version ' , targetEntity: VersionProvideLink::class, cascade: ['persist ' , 'detach ' , 'remove ' ])]
67- protected Collection $ provide ;
68-
69- #[ORM \OneToMany(mappedBy: 'version ' , targetEntity: VersionReplaceLink::class, cascade: ['persist ' , 'detach ' , 'remove ' ])]
70- protected Collection $ replace ;
71-
72- #[ORM \OneToMany(mappedBy: 'version ' , targetEntity: VersionSuggestLink::class, cascade: ['persist ' , 'detach ' , 'remove ' ])]
73- protected Collection $ suggest ;
74-
75- #[ORM \ManyToMany(targetEntity: Keyword::class, inversedBy: 'versions ' , cascade: ['persist ' , 'detach ' , 'remove ' ])]
76- protected Collection $ keywords ;
77-
78- #[ORM \Column]
79- protected array $ autoload = [];
80-
81- /**
82- * @var string[]|null
83- */
84- #[ORM \Column(nullable: true )]
85- protected ?array $ binaries = null ;
86-
87- /**
88- * @var string[]|null
89- */
90- #[ORM \Column(nullable: true )]
91- protected ?array $ includePaths = null ;
92-
93- #[ORM \Column(nullable: true )]
94- protected ?array $ phpExt = null ;
95-
96- #[ORM \Column(nullable: true )]
97- protected ?array $ authors = null ;
98-
99- #[ORM \Column(nullable: true )]
100- protected ?array $ support = null ;
101-
102- #[ORM \Column(nullable: true )]
103- protected ?array $ funding = null ;
104-
105- #[ORM \Column(nullable: true )]
106- protected ?array $ extra = null ;
107-
10829 #[ORM \Column]
10930 private bool $ defaultBranch = false ;
11031
11132 #[ORM \Column(nullable: true )]
11233 private ?\DateTimeImmutable $ updatedAt = null ;
11334
114- #[ORM \Column(nullable: true )]
115- protected ?\DateTimeImmutable $ releasedAt = null ;
116-
11735 #[ORM \ManyToOne(targetEntity: Package::class, inversedBy: 'versions ' )]
11836 #[ORM \JoinColumn(nullable: false , onDelete: 'CASCADE ' )]
11937 private Package $ package ;
@@ -130,15 +48,7 @@ class Version extends TrackedEntity
13048 public function __construct (Package $ package )
13149 {
13250 $ this ->package = $ package ;
133- $ this ->packageName = $ package ->getName ();
134-
135- $ this ->require = new ArrayCollection ();
136- $ this ->devRequire = new ArrayCollection ();
137- $ this ->conflict = new ArrayCollection ();
138- $ this ->provide = new ArrayCollection ();
139- $ this ->replace = new ArrayCollection ();
140- $ this ->suggest = new ArrayCollection ();
141- $ this ->keywords = new ArrayCollection ();
51+
14252 $ this ->installations = new VersionInstallations ($ this );
14353 $ this ->metadata = new ArrayCollection ();
14454 }
0 commit comments