diff --git a/deploy.php b/deploy.php index b94f81c..77bd203 100644 --- a/deploy.php +++ b/deploy.php @@ -7,7 +7,7 @@ set('ssh_multiplexing', true); // Configuration -set('repository', 'ssh://gogs@gogs.ragnarok.yvan.hu:2206/Laterex/webnaplo-gul-api.git'); +set('repository', 'ssh://gogs@gogs.ragnarok.yvan.hu:2206/Laterex/webnaplo-gulbaba-api.git'); set('shared_files', [ 'config/autoload/local.php', 'config/autoload/doctrine.local.php', @@ -27,12 +27,12 @@ set('default_stage', 'production'); host('lxuz.hu') ->stage('production') - ->user('latuzcs_beik_api_access') + ->user('benkeg_gulbaba_api_access') ->forwardAgent() ->set('bin/php', '/usr/bin/php7.1') - ->set('bin/composer', '{{bin/php}} /var/www/clients/client5/web20/bin/composer') + ->set('bin/composer', '{{bin/php}} /var/www/clients/client4/web38/bin/composer') ->set('php_service_name', 'php7.1-fpm') - ->set('deploy_path', '/var/www/clients/client5/web20/deploy'); + ->set('deploy_path', '/var/www/clients/client4/web38/deploy'); // Tasks diff --git a/src/App/Entity/FacilityLocation.php b/src/App/Entity/FacilityLocation.php index 3aea642..3896c2a 100644 --- a/src/App/Entity/FacilityLocation.php +++ b/src/App/Entity/FacilityLocation.php @@ -2,14 +2,14 @@ namespace App\Entity; +use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\Mapping as ORM; use Gedmo\Mapping\Annotation as Gedmo; use JsonSerializable; /** - * @Gedmo\Tree(type="closure") - * @Gedmo\TreeClosure(class="App\Entity\FacilityLocationClosure") - * @ORM\Entity(repositoryClass="Gedmo\Tree\Entity\Repository\ClosureTreeRepository") + * @Gedmo\Tree(type="nested") + * @ORM\Entity(repositoryClass="Gedmo\Tree\Entity\Repository\NestedTreeRepository") * @ORM\Table( * name="facility_locations", * indexes={ @@ -54,18 +54,38 @@ class FacilityLocation implements JsonSerializable */ private $level; + /** + * @Gedmo\TreeLeft + * @ORM\Column(name="lft", type="integer") + */ + private $lft; + + /** + * @Gedmo\TreeRight + * @ORM\Column(name="rgt", type="integer") + */ + private $rgt; + + /** + * @Gedmo\TreeRoot + * @ORM\ManyToOne(targetEntity="FacilityLocation") + * @ORM\JoinColumn(name="tree_root", referencedColumnName="id", onDelete="CASCADE") + */ + private $root; + /** * @Gedmo\TreeParent - * @ORM\JoinColumn(referencedColumnName="id", onDelete="CASCADE") + * @ORM\JoinColumn(name="parent_id", referencedColumnName="id", onDelete="CASCADE") * @ORM\ManyToOne(targetEntity="FacilityLocation", inversedBy="children") * @var FacilityLocation */ private $parent; /** - * @var FacilityLocationClosure[] + * @ORM\OneToMany(targetEntity="FacilityLocation", mappedBy="parent") + * @ORM\OrderBy({"lft" = "ASC"}) */ - private $closures = []; + private $children; /** * @ORM\Column(name="active", type="boolean", options={"default": true}) @@ -73,6 +93,11 @@ class FacilityLocation implements JsonSerializable */ private $active = true; + public function __construct() + { + $this->children = new ArrayCollection(); + } + /** * @return int */ @@ -153,16 +178,6 @@ class FacilityLocation implements JsonSerializable return $this->level; } - /** - * @param mixed $level - * @return FacilityLocation - */ - public function setLevel($level) - { - $this->level = $level; - return $this; - } - /** * @return mixed */ @@ -182,11 +197,11 @@ class FacilityLocation implements JsonSerializable } /** - * @param FacilityLocationClosure $closure + * @return FacilityLocation[]|ArrayCollection */ - public function addClosure(FacilityLocationClosure $closure) + public function getChildren(): ?ArrayCollection { - $this->closures[] = $closure; + return $this->children; } /** diff --git a/src/App/Entity/FacilityLocationClosure.php b/src/App/Entity/FacilityLocationClosure.php deleted file mode 100644 index d171b6a..0000000 --- a/src/App/Entity/FacilityLocationClosure.php +++ /dev/null @@ -1,15 +0,0 @@ -deviceGroups = new ArrayCollection(); -// $this->year = date("Y"); - $this->year = 2018; + $this->year = date("Y"); +// $this->year = 2018; } /** @@ -99,7 +99,7 @@ class XlsxParserService $sheet = $objPHPExcel->getSheetByName(self::XLSX_SHEET_NAME); $totalRows = $sheet->getHighestRow(); - $monthColumns = $this->year == 2017 + $monthColumns = $this->year == 2018 ? range(43, 58) : range(11, 58); $rowCursor = 7;