$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 = mfValuecache::singleton()->getMfObject("Address", $this->operator_id); if(!$operator) { 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; } }