dev-master
9999999-devActive Record Collection implementation for the Yii framework
BSD-3-Clause
The Requires
- php >=5.6.0
- yiisoft/yii2 ~2.0.14
collection yii2 active-record
Wallogit.com
2017 © Pedro Peláez
Active Record Collection implementation for the Yii framework
This extension provides a generic data collection as well as a collection for the ActiveRecord DB layer of Yii 2., (*2)
Development is currently in experimental state. It is not ready for production use and may change significantly., (*3)
For license information check the LICENSE-file., (*4)
Documentation is at docs/guide/README.md., (*5)
The preferred way to install this extension is through composer., (*7)
Either run, (*8)
php composer.phar require --prefer-dist yiisoft/yii2-collection
or add, (*9)
"yiisoft/yii2-collection": "~1.0.0"
to the require section of your composer.json., (*10)
To use this extension, you have to attach the yii\collection\CollectionBehavior to the ActiveQuery instance of
your ActiveRecord classes by overriding the find() method:, (*11)
/**
* {@inheritdoc}
* @return \yii\db\ActiveQuery|\yii\collection\CollectionBehavior
*/
public static function find()
{
$query = parent::find();
$query->attachBehavior('collection', \yii\collection\CollectionBehavior::class);
return $query;
}
Active Record Collection implementation for the Yii framework
BSD-3-Clause
collection yii2 active-record