Skip to content

Commit

Permalink
reformat hasXxx to multiline
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Jan 20, 2021
1 parent 8bdc24d commit 2e42ece
Showing 1 changed file with 28 additions and 8 deletions.
36 changes: 28 additions & 8 deletions demos/init-db.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,15 @@ protected function init(): void
$this->addField($this->fieldName()->type, ['caption' => 'MIME Type']);
$this->addField($this->fieldName()->is_folder, ['type' => 'boolean']);

$this->hasMany($this->fieldName()->SubFolder, ['model' => [self::class], 'their_field' => self::hinting()->fieldName()->parent_folder_id])
$this->hasMany($this->fieldName()->SubFolder, [
'model' => [self::class],
'their_field' => self::hinting()->fieldName()->parent_folder_id
])
->addField($this->fieldName()->count, ['aggregate' => 'count', 'field' => $this->persistence->expr($this, '*')]);

$this->hasOne($this->fieldName()->parent_folder_id, ['model' => [Folder::class]])
$this->hasOne($this->fieldName()->parent_folder_id, [
'model' => [Folder::class],
])
->addTitle();
}

Expand Down Expand Up @@ -308,8 +313,14 @@ protected function init(): void
parent::init();
$this->addField($this->fieldName()->name);

$this->hasMany($this->fieldName()->SubCategories, ['model' => [SubCategory::class], 'their_field' => SubCategory::hinting()->fieldName()->product_category_id]);
$this->hasMany($this->fieldName()->Products, ['model' => [Product::class], 'their_field' => Product::hinting()->fieldName()->product_category_id]);
$this->hasMany($this->fieldName()->SubCategories, [
'model' => [SubCategory::class],
'their_field' => SubCategory::hinting()->fieldName()->product_category_id
]);
$this->hasMany($this->fieldName()->Products, [
'model' => [Product::class],
'their_field' => Product::hinting()->fieldName()->product_category_id
]);
}
}

Expand All @@ -329,8 +340,13 @@ protected function init(): void
parent::init();
$this->addField($this->fieldName()->name);

$this->hasOne($this->fieldName()->product_category_id, ['model' => [Category::class]]);
$this->hasMany($this->fieldName()->Products, ['model' => [Product::class], 'their_field' => Product::hinting()->fieldName()->product_category_id]);
$this->hasOne($this->fieldName()->product_category_id, [
'model' => [Category::class]
]);
$this->hasMany($this->fieldName()->Products, [
'model' => [Product::class],
'their_field' => Product::hinting()->fieldName()->product_category_id
]);
}
}

Expand All @@ -351,8 +367,12 @@ protected function init(): void
parent::init();
$this->addField($this->fieldName()->name);
$this->addField($this->fieldName()->brand);
$this->hasOne($this->fieldName()->product_category_id, ['model' => [Category::class]])->addTitle();
$this->hasOne($this->fieldName()->product_sub_category_id, ['model' => [SubCategory::class]])->addTitle();
$this->hasOne($this->fieldName()->product_category_id, [
'model' => [Category::class]
])->addTitle();
$this->hasOne($this->fieldName()->product_sub_category_id, [
'model' => [SubCategory::class]
])->addTitle();
}
}

Expand Down

0 comments on commit 2e42ece

Please sign in to comment.