Update function 'local_webhooks_create_record'
This commit is contained in:
		@@ -389,7 +389,7 @@ class local_webhooks_external extends external_api {
 | 
				
			|||||||
     * Create an entry in the database.
 | 
					     * Create an entry in the database.
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * @param  array   $service
 | 
					     * @param  array   $service
 | 
				
			||||||
     * @return number
 | 
					     * @return boolean
 | 
				
			||||||
     * @since  Moodle 2.9 Options available
 | 
					     * @since  Moodle 2.9 Options available
 | 
				
			||||||
     * @since  Moodle 2.2
 | 
					     * @since  Moodle 2.2
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
@@ -413,8 +413,7 @@ class local_webhooks_external extends external_api {
 | 
				
			|||||||
            $record->events[$value["name"]] = $value["value"];
 | 
					            $record->events[$value["name"]] = $value["value"];
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $result = local_webhooks_create_record($record);
 | 
					        return local_webhooks_create_record($record);
 | 
				
			||||||
        return $result;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
@@ -424,7 +423,7 @@ class local_webhooks_external extends external_api {
 | 
				
			|||||||
     * @since  Moodle 2.2
 | 
					     * @since  Moodle 2.2
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public static function create_record_returns() {
 | 
					    public static function create_record_returns() {
 | 
				
			||||||
        return new external_value(PARAM_INT, "Service identifier.");
 | 
					        return new external_value(PARAM_BOOL, "The result of the operation.");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										4
									
								
								lib.php
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								lib.php
									
									
									
									
									
								
							@@ -124,7 +124,7 @@ function local_webhooks_get_list_events() {
 | 
				
			|||||||
 * Create an entry in the database.
 | 
					 * Create an entry in the database.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * @param  object  $record
 | 
					 * @param  object  $record
 | 
				
			||||||
 * @return number
 | 
					 * @return boolean
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
function local_webhooks_create_record($record) {
 | 
					function local_webhooks_create_record($record) {
 | 
				
			||||||
    global $DB;
 | 
					    global $DB;
 | 
				
			||||||
@@ -141,7 +141,7 @@ function local_webhooks_create_record($record) {
 | 
				
			|||||||
    /* Event notification */
 | 
					    /* Event notification */
 | 
				
			||||||
    local_webhooks_events::service_added($result);
 | 
					    local_webhooks_events::service_added($result);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return $result;
 | 
					    return boolval($result);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user