2017 © Pedro Peláez
 

yii2-extension pgsqlint

Enable work with PostgreSQL array of integer, in AR.

image

barkov/pgsqlint

Enable work with PostgreSQL array of integer, in AR.

  • Friday, January 13, 2017
  • by barkovrman
  • Repository
  • 1 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Enable work with PostgreSQL array of integer, in yii2 ActiveRecord., (*1)

This extension contains validator and behavior., (*2)

Installation

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

php composer.phar require --prefer-dist barkov/pgsqlint "dev-master"

or add, (*4)

"barkov/pgsqlint": "dev-master"

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

Usage

Validator, (*6)

use barkov\pgsqlint\PgIntegerArrayValidator; ..., (*7)

    public function rules(){
        return [['field_name', 'intArray', 'skipOnEmpty' => true]];
    }   

Behavior, (*8)

In your ActiveRecord model., (*9)

 public function behaviors(){
        return
        [
            'PgIntegerArrayBehavior' => [
                'class' =>  \barkov\pgsqlint\PgIntegerArrayBehavior::className(),
                'field' => 'field_name',
            ]
         ]
    } 

Note: If use as behavior - validator included. You don't need adding validation., (*10)

The Versions

13/01 2017

dev-master

9999999-dev

Enable work with PostgreSQL array of integer, in AR.

  Sources   Download

BSD-3-Clause

The Requires

 

by Barkov Roman

extension postgres yii2