active-record icon indicating copy to clipboard operation
active-record copied to clipboard

Active Record database abstraction layer

Results 92 active-record issues
Sort by recently updated
recently updated
newest added

### What steps will reproduce the problem? ```php $dataProvider = new ActiveDataProvider([ 'query' => $query->joinWith(['someCaseInsensitiveRelation']), ]); ``` ### What is the expected result? So If I make request without `dataProvider`,...

I have 2 AR models: `User` and `Role` connected via junction table. I need to ensure that only certain `Role` models attached to `User` model. IDs of roles are given....

type:enhancement

### What steps will reproduce the problem? Link models ### What is the expected result? I expect the the function to link models without saving the foreign model. ### Additional...

Historically in Yii2 one of the parts where it is really hard to inverse dependencies is AR. The current AR implementation uses a static factory `Car::find()` which creates a query...

Currrently there is no possibility to dynamically manage relations that should be included to respond in case when relation level is bigger than one. For example we have model Business...

type:enhancement
status:under discussion

Is it possible now (and how ?), is it planned, or how can I do it myself ? Let's assume we have models `Customer`, `Contract` ,`Department`, `JobPosition`, `Worker`, `NotifyChannel` all...

type:enhancement

Not sure if it should be like this but if `find()` is overridden with a default condition, this will affect refresh() so that it will return false even if the...

type:bug
status:under discussion

It would be nice to know, what attributes are going to be saved in beforeSave method. If you have some logic, which fires before saving particular attribute, that logic will...

Hi! I have idea - add method to \yii\db\ActiveRecord. I think it conveniently. ```php /** * @return bool */ public function hasChanges(): bool { return sizeof($this->getDirtyAttributes()) > 0; } ```...

type:enhancement
status:ready for adoption

### What steps will reproduce the problem? for example I have three tables. order , item , order_item ``` Class Order extends ActiveRecord { public function getItems() { return $this->hasMany(Item::className(),...

status:to be verified