Skip to content

Commit

Permalink
Revert "test using actual name in "their_field""
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Feb 22, 2021
1 parent 198fea4 commit bb2fd56
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions demos/init-db.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ protected function init(): void

$this->hasOne($this->fieldName()->client_country_iso, [
'model' => [Country::class],
'their_field' => preg_replace('~^atk_fp_~', 'atk_afp_', Country::hinting()->fieldName()->iso),
'their_field' => Country::hinting()->fieldName()->iso,
'type' => 'string',
'ui' => [
'form' => [Form\Control\Line::class],
Expand Down Expand Up @@ -258,7 +258,7 @@ 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' => preg_replace('~^atk_fp_~', 'atk_afp_', 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]])
Expand Down Expand Up @@ -339,8 +339,8 @@ protected function init(): void
parent::init();
$this->addField($this->fieldName()->name);

$this->hasMany($this->fieldName()->SubCategories, ['model' => [SubCategory::class], 'their_field' => preg_replace('~^atk_fp_~', 'atk_afp_', SubCategory::hinting()->fieldName()->product_category_id)]);
$this->hasMany($this->fieldName()->Products, ['model' => [Product::class], 'their_field' => preg_replace('~^atk_fp_~', 'atk_afp_', 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 @@ -360,7 +360,7 @@ protected function init(): void
$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' => preg_replace('~^atk_fp_~', 'atk_afp_', Product::hinting()->fieldName()->product_sub_category_id)]);
$this->hasMany($this->fieldName()->Products, ['model' => [Product::class], 'their_field' => Product::hinting()->fieldName()->product_sub_category_id]);
}
}

Expand Down

0 comments on commit bb2fd56

Please sign in to comment.