public static function create_object($object_type = null, $ua_parent_object = null) { $error = new argent_error(); if (!self::valid_object_type($object_type)) { $error->add('1036', 'Unregistered object type', $object_type, 'argent_meta'); } if (!self::object_registered($ua_parent_object)) { $error->add('1038', 'Object does not exist', $ua_parent_object, 'argent_meta'); } $object = argent_meta::register_object($object_type, $ua_parent_object); if (argent_error::check($object)) { return $object; } $record = array('object_id' => $object); $record = argent_meta::add_meta($record); $table = self::type_info($object_type); argent_meta::save_record($record, $table['table']); if ($error->has_errors()) { return $error; } return $object; }