I am looking for plugin for NetBeans PHP (or it can be some external tool) that would do something like that:
I know it's not difficult to write such tool, but maybe it already exists.
Netbeans has some built-in functionality similar to this already. In any PHP project, create a new PHP Class (right click a folder in the project, New -> PHP Class). Enter your properties, such as:
class user
{
private $id;
private $username;
private $email;
private $firstname;
| <-- position the cursor here and press Alt+Insert
}
Alt+Insert will bring up a menu that allows you to generate a constructor, getters, and setters to assign values to your properties.
If you want to do more, you can look at this Netbeans article on code generation.
There's not such plugin for NetBEans (AFAIK), but it's not the job for it anyway. Such classes can be created automatically from YAML/XML/database schema meta data. ORMs usually have tools for that, but creating your own should not be difficult either.