Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function open()
- {
- if ($this->publishable_type === 'credit') {
- // verify credit is available and anything else that
- // needs to be done before a credit job is opened
- } elseif ($this->publishable_type === 'daily) {
- // charge credit card or anything that needs to be
- // done before a daily job is opened
- } elseif ($this->publishable_type === 'plan' {
- // an elseif for any other types
- }
- $this->status = 'open';
- $this->save();
- // and any other code that has to be executed when a job is
- // opened regardless of which publishable type is chosen
- if ($this->publishable_type === 'credit') {
- // assign credit to job
- } elseif ($this->publishable_type === 'daily) {
- // whatever needs to be done for daily job
- } elseif ($this->publishable_type === 'plan' {
- // an elseif for any other types
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement