OneToManyField example

new JsonField(['name' => 'payload', 'storeApiAware' => false]),
                        new EmailField(['name' => 'email', 'storeApiAware' => false]),
                        new PriceField(['name' => 'price', 'storeApiAware' => false]),
                        new DateField(['name' => 'my_date', 'storeApiAware' => false]),
                        new ManyToManyField(['name' => 'products', 'storeApiAware' => true, 'reference' => 'product', 'inherited' => false]),
                        new ManyToOneField(['name' => 'top_seller_restrict', 'storeApiAware' => true, 'reference' => 'product', 'required' => false, 'inherited' => false, 'onDelete' => 'restrict']),
                        new ManyToOneField(['name' => 'top_seller_cascade', 'storeApiAware' => true, 'reference' => 'product', 'required' => true, 'inherited' => false, 'onDelete' => 'cascade']),
                        new ManyToOneField(['name' => 'top_seller_set_null', 'storeApiAware' => true, 'reference' => 'product', 'inherited' => false, 'onDelete' => 'set-null']),
                        new OneToOneField(['name' => 'link_product_restrict', 'storeApiAware' => false, 'reference' => 'product', 'inherited' => false, 'onDelete' => 'restrict']),
                        new OneToOneField(['name' => 'link_product_cascade', 'storeApiAware' => false, 'reference' => 'product', 'inherited' => false, 'onDelete' => 'cascade']),
                        new OneToOneField(['name' => 'link_product_set_null', 'storeApiAware' => false, 'reference' => 'product', 'inherited' => false, 'onDelete' => 'set-null']),
                        new OneToManyField(['name' => 'links_restrict', 'storeApiAware' => true, 'reference' => 'category', 'onDelete' => 'restrict']),
                        new OneToManyField(['name' => 'links_set_null', 'storeApiAware' => true, 'reference' => 'category', 'onDelete' => 'set-null']),

                        new OneToManyField(['name' => 'comments', 'storeApiAware' => true, 'reference' => 'ce_blog_comment', 'onDelete' => 'cascade', 'reverseRequired' => true]),

                        new ManyToManyField(['name' => 'inherited_products', 'storeApiAware' => true, 'reference' => 'product', 'inherited' => true]),
                        new ManyToOneField(['name' => 'inherited_top_seller', 'storeApiAware' => true, 'reference' => 'product', 'required' => false, 'inherited' => true, 'onDelete' => 'set-null']),
                        new OneToOneField(['name' => 'inherited_link_product', 'storeApiAware' => true, 'reference' => 'product', 'required' => false, 'inherited' => true, 'onDelete' => 'set-null']),
                    ],
                ]),
                new Entity([
                    'name' => 'ce_blog_comment',
                    
Home | Imprint | This part of the site doesn't use cookies.