Last active
November 20, 2015 16:59
-
-
Save mjclemente/c27cbb7b1002ce34c329 to your computer and use it in GitHub Desktop.
Bean using properties
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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