Contract WIP
This commit is contained in:
@@ -218,8 +218,22 @@ class mfBaseModel {
|
||||
}
|
||||
}
|
||||
|
||||
// generic functions for entity-classes
|
||||
public function toArray() {
|
||||
if(!$this->id) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$item = [];
|
||||
$item['id'] = $this->id;
|
||||
foreach($this->data as $key => $value) {
|
||||
$item[$key] = $value;
|
||||
}
|
||||
|
||||
return $item;
|
||||
}
|
||||
|
||||
// generic functions for entity-classes
|
||||
|
||||
public function __toString() {
|
||||
return (string) $this->data->Name;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user