Download the PHP package devatmaliance/repository without Composer

On this page you can find all versions of the php package devatmaliance/repository. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package repository

repository

Repository для испоьзования общего интерфейса для добавления, обновления и удаления записей из Мастера

Приминение RepositoryService

1) Создаем

$service = new RepositoryService( $this->request->rawBody, new RepositoryYii, new ActionReceiverDTO, new RepositoryEntity, new ServiceReceiverMapperDTO )

2) $this->request->rawBody = json new RepositoryYii - класс, который совершает все необходимые действия для синхроннизации create, update, delete 3 самых важных момента для понимания работы с данным классом

- public const SCENARIO = 'master_model_changes';
- private ActionDTOInterface $actionDTO;
- private RepositoryEntityInterface $repositoryEntity; 

SCENARIO = 'master_model_changes' - используется для того, чтобы не срабатывало поведение, которое может уже быть привязано к одной из модели, поведение отправляет по апи запрос на добавление, изменение или удалении записи из таблицы, если данный функционал используется через формы или консоль.

private ActionDTOInterface $actionDTO;

это наша ДТО, которая заполняется при получении json файла также передается в initDTO, вторым параметром ServiceReceiverMapperDTOInterface, который служит для маппинга полей под нашу модель.

Пример:

$this->actionDTO->initDTO($this->body, $this->mapperDTO);

Класс Entity

class ServiceReceiverMapperDTO implements ServiceReceiverMapperDTOInterface {

public function mapDtos(): array
{
   return [
        Entity::DEVICE => DeviceDTO::class
    ];
}

public function getMapDto(string $entity): array
{
    $dto = $this->mapDtos()[$entity] ?? [];
    return $dto ? ['fields' => $dto] : [];
}

}

public function initDTO(\stdClass $source, ?ServiceReceiverMapperDTOInterface $mapperDTO): void { $dtoMap = isset($source->entity) ? $mapperDTO->getMapDto($source->entity) : []; $this->loadSource($source, $dtoMap);

    if (!$this->validate()) {
        throw new ModelNotValidateException($this);
    }
}

private RepositoryEntityInterface $repositoryEntity - тут мы заполняем массив Entity => Model, с которыми наш микросервис будет работать. Например: мы только синхронизируем с двумя сущностями и относим их к нащим моделям в сервисе, для выполнения операций уже с ними.

class RepositoryEntity implements RepositoryEntityInterface {

public function entities(): array
{
    return [
        Entity::DEVICE => new Device(),
        Entity::FILTERS => new Filters(),
    ];
}

}

3) $repositoryService->execute() - и вызываем фунцию, происходит запись в нашу базу и возвращает массив с полями модели.


All versions of repository with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package devatmaliance/repository contains the following files

Loading the files please wait ...