false, 'created' => new DateTime($args['published'] ?? 'now'), 'content' => $args['content'] ?? null, 'content_type' => 'text/html', 'rendered' => null, 'modified' => new DateTime(), 'source' => $source, ]; if ($map['content'] !== null) { Event::handle('RenderNoteContent', [ $map['content'], $map['content_type'], &$map['rendered'], Actor::getById(1), // just for testing null, // reply to ]); } $obj = new Note(); foreach ($map as $prop => $val) { $set = Formatting::snakeCaseToCamelCase("set_{$prop}"); $obj->{$set}($val); } return $obj; } }