Advertisement
Guest User

Untitled

a guest
Apr 28th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. public function open()
  2. {
  3. if ($this->publishable_type === 'credit') {
  4. // verify credit is available and anything else that
  5. // needs to be done before a credit job is opened
  6. } elseif ($this->publishable_type === 'daily) {
  7. // charge credit card or anything that needs to be
  8. // done before a daily job is opened
  9. } elseif ($this->publishable_type === 'plan' {
  10. // an elseif for any other types
  11. }
  12.  
  13. $this->status = 'open';
  14. $this->save();
  15. // and any other code that has to be executed when a job is
  16. // opened regardless of which publishable type is chosen
  17.  
  18. if ($this->publishable_type === 'credit') {
  19. // assign credit to job
  20. } elseif ($this->publishable_type === 'daily) {
  21. // whatever needs to be done for daily job
  22. } elseif ($this->publishable_type === 'plan' {
  23. // an elseif for any other types
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement