public function beforeDelete() { if (parent::beforeDelete()) { Contact::deleteAll('member_id = :member_id', [':member_id' => $this->id]); foreach ($this->codes as $code) { if ($code->delete() === false) { return false; } } return true; } return false; }
public function beforeDelete() { if (parent::beforeDelete()) { // Delete all votes associated with the option. foreach ($this->votes as $vote) { if ($vote->delete() === false) { return false; } } return true; } return false; }
public function beforeDelete() { if (parent::beforeDelete()) { // Delete the vote associated with the code. if ($this->vote) { if ($this->vote->delete() === false) { return false; } } return true; } return false; }
public function beforeDelete() { if (parent::beforeDelete()) { foreach ($this->codes as $code) { if ($code->delete() === false) { return false; } } foreach ($this->members as $member) { if ($member->delete() === false) { return false; } } Option::deleteAll('poll_id = :poll_id', [':poll_id' => $this->id]); //foreach ($this->options as $option) { //if ($option->delete() === false) { //return false; //} //} return true; } return false; }