Finished Addressattribute
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
class Address extends mfBaseModel {
|
||||
protected $forcestr = ['company','zip','phone','fax','mobile','note'];
|
||||
private $types;
|
||||
|
||||
private $attributes;
|
||||
|
||||
public function getFullName() {
|
||||
// Assumes "Firma1 Firma2" or "firstname lastname" as readable form
|
||||
@@ -44,6 +44,17 @@ class Address extends mfBaseModel {
|
||||
return $this->types;
|
||||
}
|
||||
|
||||
if($name == "attributes") {
|
||||
$attribs = AddressattributeModel::search(['address_id' => $this->id]);
|
||||
if(count($attribs)) {
|
||||
$this->attributes = [];
|
||||
foreach($attribs as $a) {
|
||||
$this->attributes[$a->name] = $a;
|
||||
}
|
||||
}
|
||||
return $this->attributes;
|
||||
}
|
||||
|
||||
$classname = ucfirst($name);
|
||||
$idfield = $name."_id";
|
||||
$this->$name = new $classname($this->$idfield);
|
||||
|
||||
Reference in New Issue
Block a user