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

Unexpted changing of public properties in class Screen #2778

Open
AndreyLygun opened this issue Dec 25, 2023 · 0 comments
Open

Unexpted changing of public properties in class Screen #2778

AndreyLygun opened this issue Dec 25, 2023 · 0 comments
Assignees
Labels

Comments

@AndreyLygun
Copy link

AndreyLygun commented Dec 25, 2023

it seems that value of ALL public properties of Screen is changed after query() call.
Even if this property is not changed in query()
Compare values in query() and Save

class MyScreen extends Screen
{
    protected $protected_property = 'Some protected value';
    public  $public_property  = 'Some public value';

    public function query($id = null): iterable
    {
        echo $this->protected_property; // 'Some protected value'
        echo $this->public_property;  // 'Some public value'
        return [];
    }

    public function layout(): iterable
    {
        return [Layout::rows([
            Button::make('Кнопка')->method('Save')
        ])];
    }

    public function Save()
    {
        echo $this->protected_property; // 'Some protected value'
        echo $this->public_property;  // null. WTF?!
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants