readFromDb($table_name, ['id' => $object_id]); $class = new CommonModel(); foreach (get_object_vars($data[0]) as $key => $value) { $class->$key = $value; } return $class; } public function delete() { global $dbHandler; } public function is_fullaged() : bool { return kompass_is_fullaged($this->geburtsdatum); } public function get_age() { $obj_birthday = \DateTime::createFromFormat('Y-m-d', $this->geburtsdatum); $today = new \DateTime(); $compare = date_diff($today, $obj_birthday); return $compare->y; } }