Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

has_many, many_many etc should import the namespace for HasManyList etc #120

Closed
robbieaverill opened this issue Feb 19, 2019 · 3 comments
Closed
Labels

Comments

@robbieaverill
Copy link
Contributor

Example model:

namespace Foo;
class Foo extends \SilverStripe\ORM\DataObject
{
    private static $has_many = [
        'Bars' => Bar::class,
    ];
}

namespace Bar;
class Bar extends \SilverStripe\ORM\DataObject {}

When running dev/build you'll get this in the Foo docblock:

* @method DataList|Bar[] Bars()

It's missing use SilverStripe\ORM\DataList; imported - this is a bug

@Firesphere
Copy link
Member

Isn't this pretty much what is covered in #114 ?

I like the use statement addition though, but I'm not sure how to parse that, would probably end up using regex to check if it's already there...

@Firesphere
Copy link
Member

This is only a valid issue if the shortname feature is enabled.

I agree though, it's pretty annoying

@Firesphere
Copy link
Member

Closing this for now, changing use statements feels like touching active code, which I'd rather avoid.

Feel free to open again if you disagree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants