Generating Getters and Setters
can automatically create getter and setter functions in order for 'Get'
and 'Set' function calls to be easily created.
This procedure describes how to generate getter and setter functions
for all variables within a class.
To generate getters and setters:
In a PHP file, place your
cursor within the class for which you would like to generate the getters
Right-click within the class's
source code and select Source | Generate Getters and Setters -Or- from
the Menu Bar go to Source | Generate Getters and Setters
-Or- Right-click the required class in PHP Explorer view and select
Source | Generate Getters and Setters
The 'Generate Getters and
Setters' dialog will open, displaying all variables that might require
variables getter and setter functions should be created for.
Expand the list under each function by clicking the + icon in order
to select to generate only a getter or a setter for each variable.
If your cursor was originally placed on a certain variable, this will
automatically be selected.
Point - Select the location in the class where you want the entries to
be added from the drop-down list.
method - Getters and setters will be placed as the first methods within
method - Getters and setters will be placed as the last methods within
position - Getters and setters will be placed at the cursor position (only
available if cursor was placed in a valid position).
function ... - Getters and setters will be placed after the selected function
(depending on the functions available within the class).
by - Determine the order in which the entries are entered.
The options are:
getters, then setters - All the getters will be grouped together, followed
by the setters.
in getter/setter pairs - Pairs of getters and setters relating to the
same variable will be generated together.
modifier (Not available in PHP 4 projects) - Selects whether the functions
will be public, protected, private or final.
method comments - Select whether to generate a PHP Docblock for each entry.
The relevant getter and setter functions will be generated for the selected