Bläddra i källkod

Adding includePaths property to Version entity.

Andrei Shevtsov 13 år sedan
förälder
incheckning
f1a3c6734d

+ 26 - 0
src/Packagist/WebBundle/Entity/Version.php

@@ -166,6 +166,11 @@ class Version
      */
     private $binaries;
 
+    /**
+     * @ORM\Column(type="text", nullable=true)
+     */
+    private $includePaths;
+
     /**
      * @ORM\Column(type="datetime")
      */
@@ -222,6 +227,7 @@ class Version
             'target-dir' => $this->getTargetDir(),
             'autoload' => $this->getAutoload(),
             'extra' => $this->getExtra(),
+            'include-path' => $this->getIncludePaths(),
         );
 
         if ($this->getBinaries()) {
@@ -463,6 +469,26 @@ class Version
         return json_decode($this->binaries, true);
     }
 
+    /**
+     * Set include paths.
+     *
+     * @param array $paths
+     */
+    public function setIncludePaths($paths)
+    {
+        $this->includePaths = json_encode($paths);
+    }
+
+    /**
+     * Get include paths.
+     *
+     * @return array|null
+     */
+    public function getIncludePaths()
+    {
+        return json_decode($this->includePaths, true);
+    }
+
     /**
      * Set createdAt
      *

+ 1 - 0
src/Packagist/WebBundle/Package/Updater.php

@@ -200,6 +200,7 @@ class Updater
         $version->setAutoload($data->getAutoload());
         $version->setExtra($data->getExtra());
         $version->setBinaries($data->getBinaries());
+        $version->setIncludePaths($data->getIncludePaths());
 
         $version->getTags()->clear();
         if ($data->getKeywords()) {