mirror of
https://github.com/humhub/humhub.git
synced 2025-02-25 03:34:10 +01:00
Improved contentcontainer base record lookup when contentcontainer_id is available
This commit is contained in:
parent
6d19c7fce7
commit
ba569e3cea
@ -192,6 +192,10 @@ abstract class ContentContainerActiveRecord extends ActiveRecord
|
||||
*/
|
||||
public function getContentContainerRecord()
|
||||
{
|
||||
if ($this->hasAttribute('contentcontainer_id')) {
|
||||
return $this->hasOne(ContentContainer::className(), ['id' => 'contentcontainer_id']);
|
||||
}
|
||||
|
||||
return $this->hasOne(ContentContainer::className(), ['pk' => 'id'])
|
||||
->andOnCondition(['class' => $this->className()]);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user