public function createClass()
    {
        try {
            $class = $this->createSubClass(new \core_kernel_classes_Class(TaoOntology::ITEM_CLASS_URI));

            $result = [
                'message' => __('Class successfully created.'),
                'class-uri' => $class->getUri(),
            ];

            $this->returnSuccess($result);
        } catch (\common_exception_ClassAlreadyExists $e) {
            $result = [
                'message' => $e->getMessage(),
                'class-uri' => $e->getClass()->getUri(),
            ];
            $this->returnSuccess($result);
        } catch (\Exception $e) {
            $this->returnFailure($e);
        }
    }
public function createClass()
    {
        try {
            $class = $this->createSubClass(new \core_kernel_classes_Class(TaoOntology::ITEM_CLASS_URI));

            $result = [
                'message' => __('Class successfully created.'),
                'class-uri' => $class->getUri(),
            ];

            $this->returnSuccess($result);
        } catch (\common_exception_ClassAlreadyExists $e) {
            $result = [
                'message' => $e->getMessage(),
                'class-uri' => $e->getClass()->getUri(),
            ];
            $this->returnSuccess($result);
        } catch (\Exception $e) {
            $this->returnFailure($e);
        }
    }
public function createClass ( ) { try { $ class = $ this -> createSubClass ( new \ core_kernel_classes_Class ( TaoOntology :: ITEM_CLASS_URI ) ) ; $ result = [ 'message' => __ ( 'Class successfully created.' ) , 'class-uri' => $ class -> getUri ( ) , ] ; $ this -> returnSuccess ( $ result ) ; } catch ( \ common_exception_ClassAlreadyExists $ e ) { $ result = [ 'message' => $ e -> getMessage ( ) , 'class-uri' => $ e -> getClass ( ) -> getUri ( ) , ] ; $ this -> returnSuccess ( $ result ) ; } catch ( \ Exception $ e ) { $ this -> returnFailure ( $ e ) ; } }
Create an Item Class

Label parameter is mandatory
If parent class parameter is an uri of valid test class, new class will be created under it
If not parent class parameter is provided, class will be created under root class
Comment parameter is not mandatory, used to describe new created class

@return \core_kernel_classes_Class
Create an Item Class