src/Generator/Writer/Model/Steps/StubReplaceRelationData.php
protected function determineCategoryRelationName()
    {
        // pick a name and see if it conflicts with anything
        $tryNames = config('pxlcms.generator.standard_models.category_relation_names', []);

        $this->categoryRelationName = null;

        foreach ($tryNames as $tryName) {

            $tryName = trim($tryName);

            if ( ! $this->doesRelationNameConflict($tryName)) {

                $this->categoryRelationName = $tryName;
                break;
            }
        }

        if (empty($this->categoryRelationName)) {
            $this->context->log(
                "Unable to find a non-conflicting category relation name for model #{$this->data->module}. "
                . "Relation omitted.",
                Generator::LOG_LEVEL_ERROR
            );
        }

        return $this->categoryRelationName;
    }
protected function determineCategoryRelationName()
    {
        // pick a name and see if it conflicts with anything
        $tryNames = config('pxlcms.generator.standard_models.category_relation_names', []);

        $this->categoryRelationName = null;

        foreach ($tryNames as $tryName) {

            $tryName = trim($tryName);

            if ( ! $this->doesRelationNameConflict($tryName)) {

                $this->categoryRelationName = $tryName;
                break;
            }
        }

        if (empty($this->categoryRelationName)) {
            $this->context->log(
                "Unable to find a non-conflicting category relation name for model #{$this->data->module}. "
                . "Relation omitted.",
                Generator::LOG_LEVEL_ERROR
            );
        }

        return $this->categoryRelationName;
    }
protected function determineCategoryRelationName ( ) { // pick a name and see if it conflicts with anything $ tryNames = config ( 'pxlcms.generator.standard_models.category_relation_names' , [ ] ) ; $ this -> categoryRelationName = null ; foreach ( $ tryNames as $ tryName ) { $ tryName = trim ( $ tryName ) ; if ( ! $ this -> doesRelationNameConflict ( $ tryName ) ) { $ this -> categoryRelationName = $ tryName ; break ; } } if ( empty ( $ this -> categoryRelationName ) ) { $ this -> context -> log ( "Unable to find a non-conflicting category relation name for model #{$this->data->module}. " . "Relation omitted." , Generator :: LOG_LEVEL_ERROR ) ; } return $ this -> categoryRelationName ; }
Attempts to determine a non-conflicting name for the relationship to the Category model

@return string|false
Attempts to determine a non - conflicting name for the relationship to the Category model