2017 © Pedro Peláez
 

yii2-extension yii2-record-replacer

Record replacer a help tool for yii2 framework

image

denq/yii2-record-replacer

Record replacer a help tool for yii2 framework

  • Saturday, December 12, 2015
  • by DenQ
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

yii2-recod-replacer

Record replacer a component for safe add new records or replacing that already exists, (*1)

Install

    composer require "denq/yii2-record-replacer"

Configure

    'components' => [
        'RecordReplacer' => [
            'class' => 'RecordReplacer\RecordReplacer',
        ],
        ...
    ]

Usage

    Yii::$app->RecordReplacer->Run($model, $fields, $primary)
  • $model, (*2)

    • type: \yii\db\ActiveRecord
    • description: your active record model
    • required: true
  • $fields, (*3)

    • type: array
    • description: array with fields and values
    • required: true
  • $primary, (*4)

    • type: array
    • description: searchable fields
    • required: false
    • default value: []

Example

    Yii::$app->RecordReplacer->Run(new CustomModel, [
        'field_1' => 'val 1',
        'field_2' => 'val 2',
        ...
        'field_n' => 'val n',
    ], [
        'field_n'
    ]);

The Versions

12/12 2015

dev-master

9999999-dev

Record replacer a help tool for yii2 framework

  Sources   Download

MIT

The Requires

 

by Avatar DenQ

yii2 activerecord record ar insert replace

12/12 2015

0.0.4

0.0.4.0

Record replacer a help tool for yii2 framework

  Sources   Download

MIT

The Requires

 

by Avatar DenQ

yii2 activerecord record ar insert replace

06/12 2015

0.0.3

0.0.3.0

Record replacer a help tool for yii2 framework

  Sources   Download

MIT

The Requires

 

by Avatar DenQ

yii2 activerecord record ar insert replace

06/12 2015

0.0.2

0.0.2.0

Record replacer a help tool for yii2 framework

  Sources   Download

MIT

The Requires

 

by Avatar DenQ

yii2 activerecord record ar insert replace

04/12 2015

0.0.1

0.0.1.0

Record replacer a help tool for yii2 framework

  Sources   Download

MIT

The Requires

 

by Avatar DenQ

yii2 activerecord record ar insert replace