File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -163,7 +163,16 @@ private function _associations($model, $plugin = null) {
163163 if ($ associations = $ setModel ->associations ()) {
164164 foreach ($ associations ->normalizeKeys ($ associations ->getIterator ()) as $ key => $ association ) {
165165 $ source = $ association ->source ();
166- $ target = $ association ->target ();
166+
167+ try {
168+ $ target = $ association ->target ();
169+ } catch (\Exception $ e ) {
170+ $ association ->target ()->setRegistryAlias (ucfirst ($ association ->getProperty ()) . $ association ->getName ());
171+ $ association ->target ()->setAlias (ucfirst ($ association ->getProperty ()) . $ association ->getName ());
172+ $ association ->setName (ucfirst ($ association ->getProperty ()) . $ association ->getName ());
173+ $ target = $ association ->target ();
174+ }
175+
167176 $ sourceRegistery = 'App ' ;
168177 $ targetRegistery = 'App ' ;
169178
You can’t perform that action at this time.
0 commit comments