public function getAttachmentIndex() { return $this->owner->hasMany(AttachmentIndex::className(), ['entity_id' => $this->owner->primaryKey()[0]])->where(["entity" => $this->getEntityClass(), "attribute" => $this->attribute]); }