This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 152321 - Create the generating setters and getters customizable
Summary: Create the generating setters and getters customizable
Status: RESOLVED WORKSFORME
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
: 187964 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-11-04 17:13 UTC by Petr Pisl
Modified: 2011-08-15 09:50 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Pisl 2008-11-04 17:13:57 UTC
This is based on a user request: http://blogs.sun.com/netbeansphp/entry/netbeans_ide_6_5_beta1#comment-1225807965000

The getter and setter feature is really nice...
but there is a problem if you follow Zend Framework coding standards...the private and protected properties of a class
are prefixed with an underscore '_'...in that case, the getter and setter method names generated by netbeans use
underscore instead of camel case notation...for example if the property name is $_name then the getter method name
generated is get_name(), not get getName()...is there a way to customise this feature...


It should be simple to implement.
Comment 1 chetzoff 2009-08-20 16:00:48 UTC
C'mon guys, please implement this small feature, almost a year has passed. Because of it's absence i have to edit the
generated setters and getters every time.
Comment 2 yudiset 2009-10-20 06:26:22 UTC
Any update on this issue?
I tried the latest nightly build (200910170201), and it still has not supported this feature.

Thank you.
Comment 3 Petr Pisl 2009-10-20 11:22:05 UTC
Unfortunately I haven't time to do it. But I can do now small change. Just check, whether the name property starts with
underscore and in such case it would be the underscore ignored. It will be sufficient for now?
Comment 4 bwaine 2010-08-11 14:52:50 UTC
Hi,

I to suffer from this issue. Any chance a patch?

Given the popularity of Zend Framework I can imagine many others would like this feature as well.

Thanks,

Ben
Comment 5 Petr Pisl 2010-08-11 15:02:57 UTC
Still not enough time:(. Do you need full customization or what behavior is sufficient for Zend framework developers.
Comment 6 bwaine 2010-08-11 15:36:15 UTC
Private and protected variables are prefixed with an underscore.
Getters and setters should not contain an underscore the get or set should be lower case an the variable names should be capitalised. See below:

Variables:

protected $_variable
protected $_variableTwo
protected $_variableTwentyTwo

Getters and Setters:

public function getVariable(){

}

public function getVariableTwo(){

}

public function getVariableTwentyTwo(){

}

public function setVariable($variable){

}

public function setVariableTwo($variableTwo){

}

public function setVariableTwentyTwo($variableTwentyTwo){

}


Hope this helps, thanks for your attention to the issue.

Ben
Comment 7 Ondrej Brejla 2011-08-15 09:48:53 UTC
*** Bug 187964 has been marked as a duplicate of this bug. ***
Comment 8 Ondrej Brejla 2011-08-15 09:49:59 UTC
Works for me in NB 7.0.1.