loadMe(); $data["edit_by"] = $me->id; } return $data; } protected function beforeDelete() { // delete all ISPs foreach(PreordercampaignOperatorIspModel::search(["campaignoperator_id" => $this->id]) as $isp) { $isp->delete(); } return true; } public function getProperty($name) { if($this->$name == null) { if($name == "isps") { $isps = PreordercampaignOperatorIspModel::search(["campaignoperator_id" => $this->id]); if(!$isps) { return []; } foreach($isps as $isp) { $this->isps[$isp->isp_id] = $isp; } return $this->isps; } if($name == "operator") { $operator = new Address($this->operator_id); if(!$operator->id) { return null; } $this->operator = $operator; return $this->operator; } $classname = ucfirst($name); $idfield = $name."_id"; $this->$name = mfValuecache::singleton()->getMfObject($classname, $this->$idfield); if(!$this->$name) { return null; } } return $this->$name; } }