public function delete() { $children = id(new PhragmentSnapshotChild())->loadAllWhere('snapshotPHID = %s', $this->getPHID()); $this->openTransaction(); foreach ($children as $child) { $child->delete(); } $result = parent::delete(); $this->saveTransaction(); return $result; }