2017 © Pedro Peláez
 

yii2-extension yii2-arsync

This behavior for automatic or manual sync data between two models, without declaration relation. This behavior must be attached on master model. Main purposes - for sync rarely modified data from more reliable database storage to redis storage for frequently access; Support actual data state in some development cases;

image

insolita/yii2-arsync

This behavior for automatic or manual sync data between two models, without declaration relation. This behavior must be attached on master model. Main purposes - for sync rarely modified data from more reliable database storage to redis storage for frequently access; Support actual data state in some development cases;

  • Thursday, May 12, 2016
  • by Insolita
  • Repository
  • 1 Watchers
  • 1 Stars
  • 21 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

ActiveRecord Synchronization Behavior

This behavior for automatic or manual sync data between two models, without declaration relation. This behavior must be attached on master model. Main purposes - for sync rarely modified data from more reliable database storage to redis storage for frequently access; Support actual data state in some development cases;, (*1)

Installation

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

Either run, (*3)

php composer.phar require --prefer-dist insolita/yii2-arsync "*"

or add, (*4)

"insolita/yii2-arsync": "*"

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

Usage

Once the extension is installed, simply use it in your code by : See more in code ```php public function behaviors(){ return [ 'ArSyncBehavior'=>[ 'class' => ArSyncBehavior::class, 'slaveModel' => \your\model\namespase\Slave::className(), 'slaveScenario'=>'sync', 'errorSaveCallback'=>function($slave){ Yii::error(VarDumper::export($slave->errors)); throw new InvalidConfigException('fail save '); }, 'errorDeleteCallback'=>function($slave){ Yii::error('fail delete '.$slave->getPrimaryKey()); }, 'fieldMap' => [ 'id'=>'id', 'title' => 'name', 'foo' => 'foo', 'bar' => 'bar', 'baz' => function($master) { return $master->baz * 2; }, ], ] ]; }, (*6)

The Versions

12/05 2016

dev-master

9999999-dev

This behavior for automatic or manual sync data between two models, without declaration relation. This behavior must be attached on master model. Main purposes - for sync rarely modified data from more reliable database storage to redis storage for frequently access; Support actual data state in some development cases;

  Sources   Download

MIT

The Requires

 

by Avatar Insolita

extension yii2 redis activerecord synchronization sync

12/05 2016

0.0.1

0.0.1.0

This behavior for automatic or manual sync data between two models, without declaration relation. This behavior must be attached on master model. Main purposes - for sync rarely modified data from more reliable database storage to redis storage for frequently access; Support actual data state in some development cases;

  Sources   Download

MIT

The Requires

 

by Avatar Insolita

extension yii2 redis activerecord synchronization sync