Skip to content

Instantly share code, notes, and snippets.

@platoosom
Last active September 30, 2017 03:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save platoosom/e94e5c17b7cbd1cf5e036ae24d66d193 to your computer and use it in GitHub Desktop.
Save platoosom/e94e5c17b7cbd1cf5e036ae24d66d193 to your computer and use it in GitHub Desktop.
<?php
class PostBase {
public $id;
public $title;
public $description;
public function setID($id) {
$this->id = $id;
}
final public function getID() {
return $this->id;
}
}
class Page extends PostBase {
public function getPagePrefix() {
return 'P.';
}
}
class Item extends PostBase {
public function getID() {
return 'Item#'. $this->id;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment