Fixed attributes in AddressController::save()

This commit is contained in:
Frank Schubert
2021-06-24 22:46:17 +02:00
parent 5241cfd175
commit 64b7b5498e
3 changed files with 27 additions and 1 deletions

View File

@@ -126,8 +126,9 @@ class AddressController extends mfBaseController {
$attribs = $r->attributes;
//var_dump($attribs);exit;
if(is_array($attribs) && count($attribs)) {
foreach($attribs as $atttrib => $value) {
foreach($attribs as $attrib => $value) {
$aa = AddressattributeModel::getFirst(["address_id" => $new_id, "name" => $attrib]);
if(!$aa) {
$aa = AddressattributeModel::create(["address_id" => $new_id, "name" => $attrib]);
}

View File

@@ -1,5 +1,22 @@
<?php
class Pop extends mfBaseModel {
private $network;
public function getProperty($name) {
if($this->$name == null) {
$classname = ucfirst($name);
$idfield = $name."_id";
$this->$name = new $classname($this->$idfield);
if($this->$name->id) {
return $this->$name;
} else {
return null;
}
}
return $this->$name;
}
}

View File

@@ -0,0 +1,8 @@
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/