PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.8
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.8
4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 All 139 releases
learnpress / inc / MCP / Schemas / SectionSchemas.php

SectionSchemas.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.4.8, at inc/MCP/Schemas/SectionSchemas.php

94 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace LearnPress\MCP\Schemas;
4
5 use LearnPress\MCP\Support\Schemas;
6
7 defined( 'ABSPATH' ) || exit;
8
9 /**
10 * Input/output schemas for section write tools.
11 */
12 class SectionSchemas {
13
14 /**
15 * create-section input.
16 *
17 * @return array
18 */
19 public static function create_input(): array {
20 return Schemas::object(
21 array(
22 'course_id' => Schemas::id(),
23 'name' => Schemas::string(),
24 'description' => Schemas::string(),
25 'order' => Schemas::integer( 1 ),
26 ),
27 array( 'course_id', 'name' )
28 );
29 }
30
31 /**
32 * update-section input.
33 *
34 * @return array
35 */
36 public static function update_input(): array {
37 return Schemas::object(
38 array(
39 'course_id' => Schemas::id(),
40 'section_id' => Schemas::id(),
41 'name' => Schemas::string(),
42 'description' => Schemas::string(),
43 'order' => Schemas::integer( 1 ),
44 ),
45 array( 'course_id', 'section_id' )
46 );
47 }
48
49 /**
50 * delete-section input.
51 *
52 * @return array
53 */
54 public static function delete_input(): array {
55 return Schemas::object(
56 array(
57 'course_id' => Schemas::id(),
58 'section_id' => Schemas::id(),
59 ),
60 array( 'course_id', 'section_id' )
61 );
62 }
63
64 /**
65 * Write output wrapped under "section".
66 *
67 * @return array
68 */
69 public static function write_output(): array {
70 return Schemas::object_output( 'section' );
71 }
72
73 /**
74 * delete-section output.
75 *
76 * @return array
77 */
78 public static function delete_output(): array {
79 return Schemas::object(
80 array(
81 'removed' => Schemas::boolean(),
82 'section_id' => Schemas::integer(),
83 'course_id' => Schemas::integer(),
84 'affected_items' => array(
85 'type' => 'array',
86 'items' => array( 'type' => 'object' ),
87 ),
88 'recovery' => array( 'type' => 'object' ),
89 ),
90 array( 'removed', 'section_id' )
91 );
92 }
93 }
94