Stillat / relationships

Provides automated bi-directional @statamic entry relationships
MIT License
16 stars 1 forks source link

Allow set notation for one to many relationship #24

Closed mikemartin closed 1 year ago

mikemartin commented 1 year ago

Hey mate, Is it possible to enable set notation for one to many relationships? It doesn't appear to be working. Here are my relations and the relate fill output:

Relate::oneToMany(
    'entry:{pens,markers,accessories}.refill',
    'refills.products'
);

Relate::oneToMany(
    'reviews.product',
    'entry:{pens,markers,accessories,refills}.reviews'
);

Output:

❯ php please relate:fill
Updating relationships. This may take a while if you have a lot of entries.

Updating relationship: (1-*) [refills.products {pens,markers,accessories}.refill]...
Updating relationship: (1-*) [refills.products {pens,markers,accessories}.refill]... done!
Updating relationship: (*-1) [reviews.product {pens,markers,accessories,refills}.reviews]...
Updating relationship: (*-1) [reviews.product {pens,markers,accessories,refills}.reviews]... done!
JohnathonKoster commented 1 year ago

This is now available as a new feature in v2.1.0 (S4) 🙂

Set notation has been added to all relationship types (oneToOne, oneToMany, manyToOne, manyToMany)

mikemartin commented 1 year ago

@JohnathonKoster Thanks, but it still doesn't seem to be working after the update. Relate list is listing one relationships with the set notation and not listing all the relationships.

JohnathonKoster commented 1 year ago

@mikemartin I'll get you a new version tagged here soon

🤦‍♂️🤦‍♂️I didn't merge the branch.

JohnathonKoster commented 1 year ago

@mikemartin Just tagged 2.1.1 with the actual changes. Sorry about that 🐸

mikemartin commented 1 year ago

Awesome. Thank you!