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

Can't use function name in Presenter which is equal to the name of the property #38

Open
pixelpeter opened this issue Apr 6, 2015 · 3 comments

Comments

@pixelpeter
Copy link

It seems like something has changed with Laravel 5.

Currently I'm not able to use a function name which is equal to the name of the property.
So this is not working and I can't figure it out why

public function description()
{
    return $this->description;
}

This will throw an Undefined property: App\Presenter\ApplicationPresenter::$description

The only way I could get this to work is by using a different method name

public function getDescription()
{
    return $this->description;
}

or referencing the property like this

public function description()
{
    return $this->entity->description;
}

Am I doing something wrong or is this a bug in interaction with Laravel 5 ?

@oliverasistemas
Copy link

Same problem here. Any updates?

@raywill
Copy link

raywill commented Aug 12, 2016

Really appreciate this issue.

I also encountered this problem and I was wired until I see this.

I think, at least, it should be documented to make people be aware.

@clarkewing
Copy link

@pixelpeter Thanks for the $this->entity tip!!

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

No branches or pull requests

4 participants