Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. $foo = new Foo();
  2. $foo->load(52); // Load resource #52
  3. echo 'The title of resource #52 is ' . $foo->getTitle();
  4.  
  5. class Foo extends Model
  6. {
  7. private $_id;
  8. private $_title;
  9. private $_body;
  10.  
  11. public function loadResource($id)
  12. {
  13. // ...connect to external SSH server and retrieve resource
  14. $this->_id = $resource->id;
  15. $this->_title = $resource->title;
  16. $this->_body = $resource->body;
  17. }
  18.  
  19. public function getTitle()
  20. {
  21. return $this->_title;
  22. }
  23.  
  24. public function getBody()
  25. {
  26. return $this->_body;
  27. }
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement