PHPackages                             akbsit/trait-adapter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. akbsit/trait-adapter

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

akbsit/trait-adapter
====================

Trait help to adapt data.

1.0.6(2y ago)137MITPHPPHP ^8.1

Since Mar 15Pushed 2y ago1 watchersCompare

[ Source](https://github.com/akbsit/trait-adapter)[ Packagist](https://packagist.org/packages/akbsit/trait-adapter)[ RSS](/packages/akbsit-trait-adapter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (8)Used By (0)

trait-adapter, [Packagist](https://packagist.org/packages/akbsit/trait-adapter)
===============================================================================

[](#trait-adapter-packagist)

Install
-------

[](#install)

To install package, you need run command:

```
composer require akbsit/trait-adapter
```

Usage
-----

[](#usage)

To create Adapter class, it is necessary to connect trait at the beginning `AdapterTrait`. Next, define the property `protected array $arMappingList`, where are the field correspondences denoted (it can be `= [];`).

> setAttribute() метод должен быть `protected` и возвращать `void`

Examples object initialization
------------------------------

[](#examples-object-initialization)

```
$oExampleAdapter = ExampleAdapter::make();
```

```
$oExampleAdapter = new ExampleAdapter();
```

Examples
--------

[](#examples)

1. Wrapper Adapter object:

```
