Browse Source

Refactory

Guillermo Espinoza 8 years ago
parent
commit
2974223d2a

+ 2 - 0
app/AppKernel.php

@@ -31,6 +31,8 @@ class AppKernel extends Kernel
             new WebserviceBundle\WebserviceBundle(),
             new Base\AdminBundle\BaseAdminBundle(),
             new Base\OAuthClientBundle\BaseOAuthClientBundle(),
+            new DeviceBundle\DeviceBundle(),
+            
             new StatsBundle\StatsBundle(),
         ];
 

+ 9 - 1
composer.json

@@ -40,6 +40,13 @@
             "options": {
                     "local_pk": "./keys/bitbucket.id_rsa"
             }
+        },
+        {
+            "type": "vcs",
+            "url":  "ssh://git@infra.flowdat.com:222/VendorSoftwareFlowdat3/DeviceBundle.git",
+            "options": {
+                    "local_pk": "./keys/bitbucket.id_rsa"
+            }
         }
     ],
     "require": {
@@ -64,7 +71,8 @@
         "php-amqplib/rabbitmq-bundle": "^1.12",
         "ik/base-admin-bundle": "dev-master",
         "ik/oauthclient-bundle": "dev-master",
-        "ik/webservice-bundle": "dev-master"
+        "ik/webservice-bundle": "dev-master",
+        "ik/device-bundle": "dev-master"
     },
     "require-dev": {
         "sensio/generator-bundle": "^3.0",

+ 26 - 2
composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
         "This file is @generated automatically"
     ],
-    "content-hash": "eb9095e465928315b30b603a09a932e4",
+    "content-hash": "85cafc69f977f2b38ce922b9e76ca6b3",
     "packages": [
         {
             "name": "behat/transliterator",
@@ -1275,6 +1275,29 @@
             ],
             "time": "2017-05-08 15:32:19"
         },
+        {
+            "name": "ik/device-bundle",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "ssh://git@infra.flowdat.com:222/VendorSoftwareFlowdat3/DeviceBundle.git",
+                "reference": "d3d8b2be63b5373cc4e141bf85c4243b6af92469"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "DeviceBundle\\": ""
+                }
+            },
+            "description": "Flowdat 3 Device Bundle",
+            "keywords": [
+                "Admin Generator",
+                "admin",
+                "bundle",
+                "validators"
+            ],
+            "time": "2017-05-30 12:58:26"
+        },
         {
             "name": "ik/oauthclient-bundle",
             "version": "dev-master",
@@ -5386,7 +5409,8 @@
         "voryx/restgeneratorbundle": 20,
         "ik/base-admin-bundle": 20,
         "ik/oauthclient-bundle": 20,
-        "ik/webservice-bundle": 20
+        "ik/webservice-bundle": 20,
+        "ik/device-bundle": 20
     },
     "prefer-stable": false,
     "prefer-lowest": false,

+ 1 - 1
src/StatsBundle/Admin/DeviceServerAdmin.php

@@ -9,7 +9,7 @@ use Sonata\AdminBundle\Form\FormMapper;
 use Sonata\AdminBundle\Show\ShowMapper;
 use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
 use Symfony\Component\Form\Extension\Core\Type\TextType;
-use StatsBundle\Utils\DeviceTypes;
+use DeviceBundle\Utils\DeviceTypes;
 
 class DeviceServerAdmin extends BaseAdmin
 {

+ 1 - 1
src/StatsBundle/Admin/StatsDeviceAdmin.php

@@ -7,7 +7,7 @@ use Sonata\AdminBundle\Datagrid\DatagridMapper;
 use Sonata\AdminBundle\Datagrid\ListMapper;
 use Sonata\AdminBundle\Form\FormMapper;
 use Sonata\AdminBundle\Show\ShowMapper;
-use StatsBundle\Utils\DeviceTypes;
+use DeviceBundle\Utils\DeviceTypes;
 use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
 
 class StatsDeviceAdmin extends BaseAdmin

+ 1 - 1
src/StatsBundle/Entity/DeviceServer.php

@@ -50,7 +50,7 @@ class DeviceServer
      * 
      * @Assert\NotNull
      * @Assert\All({
-     *     @Assert\Choice(callback={"StatsBundle\Utils\DeviceTypes","getChoices"})
+     *     @Assert\Choice(callback={"DeviceBundle\Utils\DeviceTypes","getChoices"})
      * })
      */
     private $deviceTypes;

+ 1 - 1
src/StatsBundle/Entity/StatsDevice.php

@@ -40,7 +40,7 @@ class StatsDevice
      * @ORM\Column(type="string", length=255)
      * 
      * @Assert\NotNull
-     * @Assert\Choice(callback={"StatsBundle\Utils\DeviceTypes","getChoices"})
+     * @Assert\Choice(callback={"DeviceBundle\Utils\DeviceTypes","getChoices"})
      */
     private $deviceType;
 

+ 0 - 34
src/StatsBundle/Utils/ChoiceTrait.php

@@ -1,34 +0,0 @@
-<?php
-
-namespace StatsBundle\Utils;
-
-trait ChoiceTrait
-{
-
-    /**
-     * @return array
-     */
-    static function getConstants()
-    {
-        $oClass = new \ReflectionClass(__CLASS__);
-
-        return $oClass->getConstants();
-    }
-
-    /**
-     * Retorna un array con todas las constantes de la clase 
-     * para utilizar en campos de tipo choice en forms
-     * 
-     * @return array
-     */
-    public static function getChoices()
-    {
-        $choices = array();
-        foreach (self::getConstants() as $constant) {
-            $choices[$constant] = $constant;
-        }
-
-        return $choices;
-    }
-
-}

+ 0 - 13
src/StatsBundle/Utils/DeviceTypes.php

@@ -1,13 +0,0 @@
-<?php
-
-namespace StatsBundle\Utils;
-
-class DeviceTypes
-{
-
-    use ChoiceTrait;
-
-    const FTTH_OLT = 'FTTHBundle\Entity\OLT';
-
-
-}