corcel / acf

Advanced Custom Fields (ACF) plugin for Corcel
127 stars 100 forks source link

Typed ACF Relationships #36

Closed jakobbuis closed 7 years ago

jakobbuis commented 7 years ago

It would be very useful if ACF relationships returned the model as set in Corcel\Post::$postTypes. I wrote a very implementation that does that in this PR. Not ready for merge though, I have two remaining corncerns:

  1. This runs an additional query for every post that should be downcasted. Is there a way we could get around this?
  2. This requires Corcel\Post::$postTypes to be made public.
jakobbuis commented 7 years ago

Ah, looks like I made a mistake. Never mind this one