Skip to content

Instantly share code, notes, and snippets.

@morontt
Created December 25, 2014 12:54
Show Gist options
  • Select an option

  • Save morontt/ff3c02e8896b09d3cb73 to your computer and use it in GitHub Desktop.

Select an option

Save morontt/ff3c02e8896b09d3cb73 to your computer and use it in GitHub Desktop.
PHP Setter Method
/**
* @param ${TYPE_HINT} $${PARAM_NAME}
#if (${STATIC} != "static")
* @return $this
#end
*/
public ${STATIC} function set${NAME}($${PARAM_NAME})
{
#if (${STATIC} == "static")
self::$${FIELD_NAME} = $${PARAM_NAME};
#else
$this->${FIELD_NAME} = $${PARAM_NAME};
return $this;
#end
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment