|
@@ -19,7 +19,7 @@ use Symfony\Component\Validator\Constraints as Assert;
|
|
|
* @ORM\Entity
|
|
|
* @ORM\Table(
|
|
|
* name="package_version",
|
|
|
- * uniqueConstraints={@ORM\UniqueConstraint(name="pkg_ver_idx",columns={"package_id","version","versionType","development"})}
|
|
|
+ * uniqueConstraints={@ORM\UniqueConstraint(name="pkg_ver_idx",columns={"package_id","version"})}
|
|
|
* )
|
|
|
* @author Jordi Boggiano <j.boggiano@seld.be>
|
|
|
*/
|
|
@@ -80,12 +80,6 @@ class Version
|
|
|
*/
|
|
|
private $version;
|
|
|
|
|
|
- /**
|
|
|
- * @ORM\Column
|
|
|
- * @Assert\NotBlank()
|
|
|
- */
|
|
|
- private $versionType;
|
|
|
-
|
|
|
/**
|
|
|
* @ORM\Column(type="boolean")
|
|
|
* @Assert\NotBlank()
|
|
@@ -107,9 +101,34 @@ class Version
|
|
|
private $authors;
|
|
|
|
|
|
/**
|
|
|
- * @ORM\OneToMany(targetEntity="Packagist\WebBundle\Entity\Requirement", mappedBy="version")
|
|
|
+ * @ORM\OneToMany(targetEntity="Packagist\WebBundle\Entity\RequireLink", mappedBy="version")
|
|
|
*/
|
|
|
- private $requirements;
|
|
|
+ private $require;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @ORM\OneToMany(targetEntity="Packagist\WebBundle\Entity\ReplaceLink", mappedBy="version")
|
|
|
+ */
|
|
|
+ private $replace;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @ORM\OneToMany(targetEntity="Packagist\WebBundle\Entity\ConflictLink", mappedBy="version")
|
|
|
+ */
|
|
|
+ private $conflict;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @ORM\OneToMany(targetEntity="Packagist\WebBundle\Entity\ProvideLink", mappedBy="version")
|
|
|
+ */
|
|
|
+ private $provide;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @ORM\OneToMany(targetEntity="Packagist\WebBundle\Entity\RecommendLink", mappedBy="version")
|
|
|
+ */
|
|
|
+ private $recommend;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @ORM\OneToMany(targetEntity="Packagist\WebBundle\Entity\SuggestLink", mappedBy="version")
|
|
|
+ */
|
|
|
+ private $suggest;
|
|
|
|
|
|
/**
|
|
|
* @ORM\Column(type="text")
|
|
@@ -166,7 +185,7 @@ class Version
|
|
|
'description' => $this->description,
|
|
|
'keywords' => $tags,
|
|
|
'homepage' => $this->homepage,
|
|
|
- 'version' => $this->version . ($this->versionType ? '-'.$this->versionType : '') . ($this->development ? '-dev':''),
|
|
|
+ 'version' => $this->version,
|
|
|
'license' => $this->license,
|
|
|
'authors' => $authors,
|
|
|
'require' => $requirements,
|
|
@@ -180,10 +199,7 @@ class Version
|
|
|
|
|
|
public function equals(Version $version)
|
|
|
{
|
|
|
- return $version->getName() === $this->getName()
|
|
|
- && $version->getVersion() === $this->getVersion()
|
|
|
- && $version->getVersionType() === $this->getVersionType()
|
|
|
- && $version->getDevelopment() === $this->getDevelopment();
|
|
|
+ return $version->getName() === $this->getName() && $version->getVersion() === $this->getVersion();
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -396,16 +412,6 @@ class Version
|
|
|
return $this->package;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * Add tags
|
|
|
- *
|
|
|
- * @param Packagist\WebBundle\Entity\Tag $tags
|
|
|
- */
|
|
|
- public function addTags(Tag $tags)
|
|
|
- {
|
|
|
- $this->tags[] = $tags;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* Get tags
|
|
|
*
|
|
@@ -485,123 +491,213 @@ class Version
|
|
|
return $this->updatedAt;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Get authors
|
|
|
+ *
|
|
|
+ * @return Doctrine\Common\Collections\Collection
|
|
|
+ */
|
|
|
+ public function getAuthors()
|
|
|
+ {
|
|
|
+ return $this->authors;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set type
|
|
|
+ *
|
|
|
+ * @param string $type
|
|
|
+ */
|
|
|
+ public function setType($type)
|
|
|
+ {
|
|
|
+ $this->type = $type;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get type
|
|
|
+ *
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getType()
|
|
|
+ {
|
|
|
+ return $this->type;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set extra
|
|
|
+ *
|
|
|
+ * @param array $extra
|
|
|
+ */
|
|
|
+ public function setExtra($extra)
|
|
|
+ {
|
|
|
+ $this->extra = $extra;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get extra
|
|
|
+ *
|
|
|
+ * @return array
|
|
|
+ */
|
|
|
+ public function getExtra()
|
|
|
+ {
|
|
|
+ return $this->extra;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set development
|
|
|
+ *
|
|
|
+ * @param Boolean $development
|
|
|
+ */
|
|
|
+ public function setDevelopment($development)
|
|
|
+ {
|
|
|
+ $this->development = $development;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get development
|
|
|
+ *
|
|
|
+ * @return Boolean
|
|
|
+ */
|
|
|
+ public function getDevelopment()
|
|
|
+ {
|
|
|
+ return $this->development;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Add tags
|
|
|
+ *
|
|
|
+ * @param Packagist\WebBundle\Entity\Tag $tags
|
|
|
+ */
|
|
|
+ public function addTag(\Packagist\WebBundle\Entity\Tag $tags)
|
|
|
+ {
|
|
|
+ $this->tags[] = $tags;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Add authors
|
|
|
*
|
|
|
* @param Packagist\WebBundle\Entity\Author $authors
|
|
|
*/
|
|
|
- public function addAuthors(Author $authors)
|
|
|
+ public function addAuthor(\Packagist\WebBundle\Entity\Author $authors)
|
|
|
{
|
|
|
$this->authors[] = $authors;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Get authors
|
|
|
+ * Add require
|
|
|
+ *
|
|
|
+ * @param Packagist\WebBundle\Entity\RequireLink $require
|
|
|
+ */
|
|
|
+ public function addRequireLink(RequireLink $require)
|
|
|
+ {
|
|
|
+ $this->require[] = $require;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get require
|
|
|
*
|
|
|
* @return Doctrine\Common\Collections\Collection
|
|
|
*/
|
|
|
- public function getAuthors()
|
|
|
+ public function getRequire()
|
|
|
{
|
|
|
- return $this->authors;
|
|
|
+ return $this->require;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Add requirements
|
|
|
+ * Add replace
|
|
|
*
|
|
|
- * @param Packagist\WebBundle\Entity\Requirement $requirements
|
|
|
+ * @param Packagist\WebBundle\Entity\ReplaceLink $replace
|
|
|
*/
|
|
|
- public function addRequirements(Requirement $requirements)
|
|
|
+ public function addReplaceLink(ReplaceLink $replace)
|
|
|
{
|
|
|
- $this->requirements[] = $requirements;
|
|
|
+ $this->replace[] = $replace;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Get requirements
|
|
|
+ * Get replace
|
|
|
*
|
|
|
* @return Doctrine\Common\Collections\Collection
|
|
|
*/
|
|
|
- public function getRequirements()
|
|
|
+ public function getReplace()
|
|
|
{
|
|
|
- return $this->requirements;
|
|
|
+ return $this->replace;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Set type
|
|
|
+ * Add conflict
|
|
|
*
|
|
|
- * @param string $type
|
|
|
+ * @param Packagist\WebBundle\Entity\ConflictLink $conflict
|
|
|
*/
|
|
|
- public function setType($type)
|
|
|
+ public function addConflictLink(ConflictLink $conflict)
|
|
|
{
|
|
|
- $this->type = $type;
|
|
|
+ $this->conflict[] = $conflict;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Get type
|
|
|
+ * Get conflict
|
|
|
*
|
|
|
- * @return string
|
|
|
+ * @return Doctrine\Common\Collections\Collection
|
|
|
*/
|
|
|
- public function getType()
|
|
|
+ public function getConflict()
|
|
|
{
|
|
|
- return $this->type;
|
|
|
+ return $this->conflict;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Set extra
|
|
|
+ * Add provide
|
|
|
*
|
|
|
- * @param array $extra
|
|
|
+ * @param Packagist\WebBundle\Entity\ProvideLink $provide
|
|
|
*/
|
|
|
- public function setExtra($extra)
|
|
|
+ public function addProvideLink(ProvideLink $provide)
|
|
|
{
|
|
|
- $this->extra = $extra;
|
|
|
+ $this->provide[] = $provide;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Get extra
|
|
|
+ * Get provide
|
|
|
*
|
|
|
- * @return array
|
|
|
+ * @return Doctrine\Common\Collections\Collection
|
|
|
*/
|
|
|
- public function getExtra()
|
|
|
+ public function getProvide()
|
|
|
{
|
|
|
- return $this->extra;
|
|
|
+ return $this->provide;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Set versionType
|
|
|
+ * Add recommend
|
|
|
*
|
|
|
- * @param string $versionType
|
|
|
+ * @param Packagist\WebBundle\Entity\RecommendLink $recommend
|
|
|
*/
|
|
|
- public function setVersionType($versionType)
|
|
|
+ public function addRecommendLink(RecommendLink $recommend)
|
|
|
{
|
|
|
- $this->versionType = $versionType;
|
|
|
+ $this->recommend[] = $recommend;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Get versionType
|
|
|
+ * Get recommend
|
|
|
*
|
|
|
- * @return string
|
|
|
+ * @return Doctrine\Common\Collections\Collection
|
|
|
*/
|
|
|
- public function getVersionType()
|
|
|
+ public function getRecommend()
|
|
|
{
|
|
|
- return $this->versionType;
|
|
|
+ return $this->recommend;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Set development
|
|
|
+ * Add suggest
|
|
|
*
|
|
|
- * @param Boolean $development
|
|
|
+ * @param Packagist\WebBundle\Entity\SuggestLink $suggest
|
|
|
*/
|
|
|
- public function setDevelopment($development)
|
|
|
+ public function addSuggestLink(SuggestLink $suggest)
|
|
|
{
|
|
|
- $this->development = $development;
|
|
|
+ $this->suggest[] = $suggest;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Get development
|
|
|
+ * Get suggest
|
|
|
*
|
|
|
- * @return Boolean
|
|
|
+ * @return Doctrine\Common\Collections\Collection
|
|
|
*/
|
|
|
- public function getDevelopment()
|
|
|
+ public function getSuggest()
|
|
|
{
|
|
|
- return $this->development;
|
|
|
+ return $this->suggest;
|
|
|
}
|
|
|
}
|