Skip to content

Instantly share code, notes, and snippets.

@srph
Last active August 29, 2015 14:08
Show Gist options
  • Select an option

  • Save srph/bd8816c53f64990e3872 to your computer and use it in GitHub Desktop.

Select an option

Save srph/bd8816c53f64990e3872 to your computer and use it in GitHub Desktop.
PHP - Getter example | Getting a pogi, example.
<?php
/**
* Usage:
* $pogi = new Pogi('Kier');
* echo $pogi->getName();
*/
class Pogi {
/**
* @access protected
*/
protected $name;
/**
* Class constructor
* @param string $pogi
*/
public function __construct($name)
{
$this->name = $name;
}
/**
* Getter for the pogi property
* @return 'Kier'
*/
public function getName()
{
return $this->name;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment