Skip to content

Commit

Permalink
GAR entities (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
marvin255 authored Sep 17, 2021
1 parent cbcfb03 commit fe060ae
Show file tree
Hide file tree
Showing 142 changed files with 9,615 additions and 5,893 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "MIT",
"require": {
"php": ">=7.4",
"liquetsoft/fias-component": "^9.0",
"liquetsoft/fias-component": "^10.0",
"elasticsearch/elasticsearch": "^7.6",
"psr/log": "^1.1",
"ext-json": "*"
Expand Down Expand Up @@ -42,7 +42,7 @@
],
"entities": [
"php -f generator/generate_entities.php",
"vendor/bin/php-cs-fixer fix --config=.php_cs.dist -v --allow-risky=yes -q"
"vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php -v --allow-risky=yes -q"
]
},
"repositories": [
Expand Down
6 changes: 4 additions & 2 deletions generator/AbstractGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,11 @@ protected function checkDir(SplFileInfo $dir): void
*
* @return string
*/
protected function unifyClassName(string $namespace): string
protected function unifyClassName(string $name): string
{
return ucfirst(trim($namespace, " \t\n\r\0\x0B\\"));
$arName = array_map('ucfirst', array_map('strtolower', explode('_', $name)));

return implode('', $arName);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion generator/MapperGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ protected function decorateClass(ClassType $class, EntityDescriptor $descriptor)
*/
private function decorateNameGetter(Method $method, EntityDescriptor $descriptor): void
{
$name = strtolower($this->unifyClassName($descriptor->getName()));
$name = strtolower($descriptor->getName());

$method->addComment('{@inheritDoc}');
$method->setVisibility('public');
Expand Down
47 changes: 0 additions & 47 deletions src/Entity/ActualStatus.php

This file was deleted.

268 changes: 268 additions & 0 deletions src/Entity/AddrObj.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,268 @@
<?php

declare(strict_types=1);

namespace Liquetsoft\Fias\Elastic\Entity;

use DateTimeInterface;

/**
* Сведения классификатора адресообразующих элементов.
*/
class AddrObj
{
/**
* Уникальный идентификатор записи. Ключевое поле.
*/
protected int $id = 0;

/**
* Глобальный уникальный идентификатор адресного объекта типа INTEGER.
*/
protected int $objectid = 0;

/**
* Глобальный уникальный идентификатор адресного объекта типа UUID.
*/
protected string $objectguid = '';

/**
* ID изменившей транзакции.
*/
protected int $changeid = 0;

/**
* Наименование.
*/
protected string $name = '';

/**
* Краткое наименование типа объекта.
*/
protected string $typename = '';

/**
* Уровень адресного объекта.
*/
protected string $level = '';

/**
* Статус действия над записью – причина появления записи.
*/
protected int $opertypeid = 0;

/**
* Идентификатор записи связывания с предыдущей исторической записью.
*/
protected ?int $previd = null;

/**
* Идентификатор записи связывания с последующей исторической записью.
*/
protected ?int $nextid = null;

/**
* Дата внесения (обновления) записи.
*/
protected ?DateTimeInterface $updatedate = null;

/**
* Начало действия записи.
*/
protected ?DateTimeInterface $startdate = null;

/**
* Окончание действия записи.
*/
protected ?DateTimeInterface $enddate = null;

/**
* Статус актуальности адресного объекта ФИАС.
*/
protected int $isactual = 0;

/**
* Признак действующего адресного объекта.
*/
protected int $isactive = 0;

public function setId(int $id): self
{
$this->id = $id;

return $this;
}

public function getId(): int
{
return $this->id;
}

public function setObjectid(int $objectid): self
{
$this->objectid = $objectid;

return $this;
}

public function getObjectid(): int
{
return $this->objectid;
}

public function setObjectguid(string $objectguid): self
{
$this->objectguid = $objectguid;

return $this;
}

public function getObjectguid(): string
{
return $this->objectguid;
}

public function setChangeid(int $changeid): self
{
$this->changeid = $changeid;

return $this;
}

public function getChangeid(): int
{
return $this->changeid;
}

public function setName(string $name): self
{
$this->name = $name;

return $this;
}

public function getName(): string
{
return $this->name;
}

public function setTypename(string $typename): self
{
$this->typename = $typename;

return $this;
}

public function getTypename(): string
{
return $this->typename;
}

public function setLevel(string $level): self
{
$this->level = $level;

return $this;
}

public function getLevel(): string
{
return $this->level;
}

public function setOpertypeid(int $opertypeid): self
{
$this->opertypeid = $opertypeid;

return $this;
}

public function getOpertypeid(): int
{
return $this->opertypeid;
}

public function setPrevid(?int $previd): self
{
$this->previd = $previd;

return $this;
}

public function getPrevid(): ?int
{
return $this->previd;
}

public function setNextid(?int $nextid): self
{
$this->nextid = $nextid;

return $this;
}

public function getNextid(): ?int
{
return $this->nextid;
}

public function setUpdatedate(DateTimeInterface $updatedate): self
{
$this->updatedate = $updatedate;

return $this;
}

public function getUpdatedate(): ?DateTimeInterface
{
return $this->updatedate;
}

public function setStartdate(DateTimeInterface $startdate): self
{
$this->startdate = $startdate;

return $this;
}

public function getStartdate(): ?DateTimeInterface
{
return $this->startdate;
}

public function setEnddate(DateTimeInterface $enddate): self
{
$this->enddate = $enddate;

return $this;
}

public function getEnddate(): ?DateTimeInterface
{
return $this->enddate;
}

public function setIsactual(int $isactual): self
{
$this->isactual = $isactual;

return $this;
}

public function getIsactual(): int
{
return $this->isactual;
}

public function setIsactive(int $isactive): self
{
$this->isactive = $isactive;

return $this;
}

public function getIsactive(): int
{
return $this->isactive;
}
}
Loading

0 comments on commit fe060ae

Please sign in to comment.