Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto generate get and set functions for objects from class variables

Status
Not open for further replies.

houen

Programmer
Dec 29, 2007
3
DK
I have created a site to ease the development of good object oriented code by automatically generating get and set

functions


Simply paste in all your instance variables and it will respond with get and set functions. It supports Java, C#,

PHP, Flash and C++.

Example:

private int $num_user;
private String $email;


generates

//-------------QUERIES-------------
public function get_num_user()int {
return $this->num_user;
}
public function get_email()String {
return $this->email;
}
//-------------COMMANDS------------
public function set_num_user($num_user) {
$this->num_user = $num_user;
}
public function set_email($email) {
$this->email = $email;
}

Whether you want camelCase or under_score in the function
name is up to you. I hope you find it useful
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top