orchidsoftware / platform

Orchid is a @laravel package that allows for rapid application development of back-office applications, admin/user panels, and dashboards.
https://orchid.software
MIT License
4.26k stars 631 forks source link

Unexpted changing of public properties in class Screen #2778

Open AndreyLygun opened 6 months ago

AndreyLygun commented 6 months ago

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?!
    }