Advertisement
Guest User

Untitled

a guest
May 25th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.39 KB | None | 0 0
  1. class Poll
  2. {
  3.   public function save()
  4.   {
  5.     if( id !== null )
  6.        $this->update();
  7.     else
  8.        $this->insert();
  9.  
  10.     // save options
  11.     for( $i=0; $i<$this->options->count(); $i++ )
  12.        $this->getOptionAt($i)->save();
  13.   }
  14. }
  15.  
  16. class PollOption
  17. {
  18.   public function save()
  19.   {
  20.       if( id !== null )
  21.           $this->update();
  22.       else
  23.           $this->insert();
  24.   }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement