PageRenderTime 74ms CodeModel.GetById 41ms RepoModel.GetById 0ms app.codeStats 0ms

/application/models/ToJsonObject.php

https://bitbucket.org/dstockto/zt_tutorial3
PHP | 39 lines | 30 code | 4 blank | 5 comment | 0 complexity | 2dfc055ac6a33fa8d9feb00b5f6ca7ea MD5 | raw file
  1. <?php
  2. /**
  3. * @author davidstockton
  4. *
  5. *
  6. */
  7. class Application_Model_ToJsonObject
  8. {
  9. public $foo;
  10. public $bar;
  11. protected $protFoo;
  12. protected $protBar;
  13. private $privFoo;
  14. private $privBar;
  15. public function __construct()
  16. {
  17. $this->foo = uniqid();
  18. $this->bar = uniqid();
  19. $this->protFoo = uniqid();
  20. $this->protBar = uniqid();
  21. $this->privFoo = uniqid();
  22. $this->privBar = uniqid();
  23. }
  24. public function toJson()
  25. {
  26. return Zend_Json::encode(
  27. array(
  28. 'foo' => $this->foo,
  29. 'bar' => $this->bar,
  30. 'protFoo' => $this->protFoo,
  31. 'privBar' => $this->privBar
  32. )
  33. );
  34. }
  35. }