public function save(array $options = array()) { if ($this->status == static::STATUS_PUBLISHED && !$this->published_at) { $this->published_at = $this->freshTimestamp(); } return parent::save($options); }
public function delete() { if ($this->exists && $this->isMainComment()) { $this->children()->delete(); } parent::delete(); }