dev-master
9999999-devEnable work with PostgreSQL array of integer, in AR.
BSD-3-Clause
The Requires
by Barkov Roman
extension postgres yii2
Wallogit.com
2017 © Pedro Peláez
Enable work with PostgreSQL array of integer, in AR.
Enable work with PostgreSQL array of integer, in yii2 ActiveRecord., (*1)
This extension contains validator and behavior., (*2)
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)
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)
Enable work with PostgreSQL array of integer, in AR.
BSD-3-Clause
extension postgres yii2