2017 © Pedro Peláez
 

yii2-extension yii2-collection

Active Record Collection implementation for the Yii framework

image

yiisoft/yii2-collection

Active Record Collection implementation for the Yii framework

  • Wednesday, May 16, 2018
  • by cebe
  • Repository
  • 24 Watchers
  • 53 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 9 Forks
  • 9 Open issues
  • 1 Versions
  • 200 % Grown

The README.md

, (*1)

ActiveRecord Collection Extension for Yii 2


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)

Latest Stable Version Total Downloads Build Status, (*6)

Installation

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)

Configuration

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;
}

The Versions

16/05 2018

dev-master

9999999-dev

Active Record Collection implementation for the Yii framework

  Sources   Download

BSD-3-Clause

The Requires

 

collection yii2 active-record