Fixed attributes in AddressController::save()
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
8
application/Pop/PopModel.php
Normal file
8
application/Pop/PopModel.php
Normal 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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user