suriq

thanks! i'll study the code it should help

suriq

My varioations of product should have same relations like PArameters and so on

suriq
  1. class Product extends DataObject
  2. {
  3. .
  4. .
  5. .
  6. private static $db = [
  7. 'Name' => 'Varchar',
  8. 'Description' => 'HTMLText'
  9. ];
  10.  
  11. private static $has_one = [
  12. 'Category' => ProductCategory::class
  13. ];
  14.  
  15.  
  16. private static $has_many = [
  17. 'Parameters' => ProductParameter::class,
  18. 'Attachements' => Attachement::class,
  19. 'Photos' => ProductPhoto::class,
  20. 'Product '
  21. ];
  22.  
  23. .
  24. .
  25. .
  26.  
  27. }
suriq

Variations. Most of parameters for product are the same but variation get special parameters

suriq

so, if i want to do recursion i need something like that?

  1. class Product extends DataObject {
suriq

I try to understand version mechanism but my php kungfu is not strong enough 😕

suriq

I used https://docs.silverstripe.org/en/4/developer_guides/model/relations/ way but i cannot do it right i suppose

Show 1 attachment(s)
docs.silverstripe.org  
Relations between Records

Developer and user documentation for the Silverstripe CMS and framework.

Hide attachment content