Skip to content

Instantly share code, notes, and snippets.

@mjclemente
Last active November 20, 2015 16:59
Show Gist options
  • Save mjclemente/c27cbb7b1002ce34c329 to your computer and use it in GitHub Desktop.
Save mjclemente/c27cbb7b1002ce34c329 to your computer and use it in GitHub Desktop.
Bean using properties
component accessors=true {
property name="userService";
property name="user_id" default="0";
property name="first_name" default="";
property name="last_name" default="";
property name="email" default="";
function init() {
return this;
}
function getID() {
return getUser_id();
}
function getFullName() {
return (variables.first_name & ' ' & variables.last_name);
}
function getLastFirstName() {
return (variables.last_name & ', ' & variables.first_name);
}
function save( ) {
return variables.userService.save( this );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment