* @author Vasilis Georgoudis * @author Corentin Perrot */ class Pressbooks_Metadata_Course extends Pressbooks_Metadata_Type { /** * The variable that holds all parent required properties * * @since 0.x * @access public */ static $required_parent_props = array( 'description', 'name' ); /** * The variable that holds the values for the settings for this schema type * * @since 0.x * @access public */ static $type_setting = array('course_type' => array('Course Type','http://schema.org/Course')); /** * The variable that holds the parents for the type * * @since 0.x * @access public */ static $type_parents = array( 'schemaTypes\Pressbooks_Metadata_Thing', 'schemaTypes\Pressbooks_Metadata_CreativeWork' ); /** * The variable that holds the properties of this schema type * * @since 0.x * @access public */ static $type_properties = array( 'courseCode' => array(false,'Course Code','The identifier for the Course used by the course provider (e.g. CS101 or 6.001).'), 'coursePrerequisites' => array(false,'Course Prerequisites','Requirements for taking the Course. May be completion of another Course or a textual description like "permission of instructor". Requirements may be a pre-requisite competency, referenced using AlignmentObject.'), 'educationalCredentialAwarded' => array(false,'Educational Credential Awarded','A description of the qualification, award, certificate, diploma or other educational credential awarded as a consequence of successful completion of this course.'), //'hasCourseInstance' => array(false,'Has Course Instance','An offering of the course at a specific time and place or through specific media or mode of study or to a specific section of students.') ); public function __construct($type_level_input) { parent::__construct($type_level_input); $this->type_fields = $this->get_all_properties(); $this->class_name = __CLASS__ .'_'. $this->type_level; $this->pmdt_populate_names(self::$type_setting); $this->pmdt_add_metabox($this->type_level); } /** * Function used for combining the current types properties with its parents fields * * @since 0.x * @access public */ public function get_all_properties() { $properties = self::$type_properties; foreach(self::$type_parents as $parentType){ $properties = array_merge($properties,$parentType::type_properties); } return $properties; } /** * Function used for comparing the instances of the schema types * * @since 0.x * @access public */ public function __toString() { return $this->class_name; } }