2017 © Pedro Peláez
 

yii2-extension yii2-1c-odata

Yii2 component for work with 1C oData via activeRecord

image

execut/yii2-1c-odata

Yii2 component for work with 1C oData via activeRecord

  • Monday, November 20, 2017
  • by eXeCUT
  • Repository
  • 2 Watchers
  • 10 Stars
  • 26 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 5 Versions
  • 8 % Grown

The README.md

Yii2 wrapper via activeRecord for 1C oData

Installation

The preferred way to install this extension is through composer., (*1)

Install

Either run, (*2)

$ php composer.phar require execut/yii2-1c-odata "dev-master"

or add, (*3)

"execut/yii2-1c-odata": "dev-master"

to the require section of your composer.json file., (*4)

Configuration example

Add to application config folowing rules:, (*5)

[
    'components' => [
        'oData' => [
            'class' => \execut\oData\Client::class,
            'host' => $odataHost,
            'path' => $odataPath,
            'options' => [
                'auth' => [
                    $odataLogin,
                    $odataPassword,
                ],
            ],
            'customColumnsTypes' => [
                // Here you custom columns types stubs configuration. Example:
                'Catalog_Контрагенты' => [
                    'НаименованиеПолное' => 'text',
                ],
            ],
        ],
    ],
];

After configuration, you must declare your models and queries on the basis of two classes: execut\oData\ActiveRecord and execut\oData\ActiveQuery, (*6)

Example model for standard document ЧекККМ (source here):, (*7)

use execut\oData\ActiveRecord;

class CheckKkm extends ActiveRecord
{
    public $complexRelations = [
        'Оплата',
        'Заказы'
    ];

    public function getОплата() {
        return $this->hasMany(CheckKkmPayment::class, [
            'Ref_Key' => 'Ref_Key',
        ]);
    }

    public static function tableName()
    {
        return 'Document_ЧекККМ';
    }
}

$check = CheckKkm::find()->andWhere([
    'Ref_Key' => '00000000-0000-0000-0000-000000000001'
])->one();
if ($check) {
    $check->attributes = [
        //...
    ];
    $check->save();
}

Your help was, would be useful

For more information, there is not enough time =(, (*8)

Planned

  • Unit tests cover
  • Extending functional to standard oData, without 1C

License

yii2-1c-odata is released under the Apache License Version 2.0. See the bundled LICENSE.md for details., (*9)

The Versions

20/11 2017

dev-master

9999999-dev

Yii2 component for work with 1C oData via activeRecord

  Sources   Download

Apache-2.0

The Requires

 

by Avatar eXeCUT

yii2 activerecord odata

20/11 2017

0.1.3

0.1.3.0

Yii2 component for work with 1C oData via activeRecord

  Sources   Download

Apache-2.0

The Requires

 

by Avatar eXeCUT

yii2 activerecord odata

17/11 2017

0.1.2

0.1.2.0

Yii2 component for work with 1C oData via activeRecord

  Sources   Download

Apache-2.0

The Requires

 

by Avatar eXeCUT

yii2 activerecord odata

16/11 2017

0.1.1

0.1.1.0

Yii2 component for work with 1C oData via activeRecord

  Sources   Download

Apache-2.0

The Requires

 

by Avatar eXeCUT

yii2 activerecord odata

16/11 2017

0.1.0

0.1.0.0

Yii2 component for work with 1C oData via activeRecord

  Sources   Download

Apache-2.0

The Requires

 

by Avatar eXeCUT

yii2 activerecord odata