public static function instantation($the_record) { $the_object = new self(); foreach ($the_record as $the_attribute => $value) { if ($the_object->has_the_attribute($the_attribute)) { $the_object->{$the_attribute} = $value; } } return $the_object; }
public static function instantiation($the_record) { $the_object = new self(); // $the_object->id = $found_user['id']; // $the_object->username = $found_user['username']; // $the_object->password = $found_user['password']; // $the_object->first_name = $found_user['first_name']; // $the_object->last_name = $found_user['last_name']; foreach ($the_record as $the_attribute => $value) { if ($the_object->has_the_attribute($the_attribute)) { $the_object->{$the_attribute} = $value; } } return $the_object; }