private function checkSeoAttributes()
    {
        $model = $this->owner;
        $transliterationFunction = $this->transliterationFunction;

        // if slug field is empty, filling one with generated slug
        if ($this->slugAttribute && $model->{$this->slugAttribute} == null) {
            $model->{$this->slugAttribute} = $transliterationFunction($model->{$this->nameAttribute});
        }

        // if some seo field is empty, filling it with name field data
        foreach ($this->seoAttributes as $seoAttribute) {
            if ($model->{$seoAttribute} == null){
                $model->{$seoAttribute} = $model->{$this->nameAttribute};
            }
        }
    }
private function checkSeoAttributes()
    {
        $model = $this->owner;
        $transliterationFunction = $this->transliterationFunction;

        // if slug field is empty, filling one with generated slug
        if ($this->slugAttribute && $model->{$this->slugAttribute} == null) {
            $model->{$this->slugAttribute} = $transliterationFunction($model->{$this->nameAttribute});
        }

        // if some seo field is empty, filling it with name field data
        foreach ($this->seoAttributes as $seoAttribute) {
            if ($model->{$seoAttribute} == null){
                $model->{$seoAttribute} = $model->{$this->nameAttribute};
            }
        }
    }
private function checkSeoAttributes ( ) { $ model = $ this -> owner ; $ transliterationFunction = $ this -> transliterationFunction ; // if slug field is empty, filling one with generated slug if ( $ this -> slugAttribute && $ model -> { $ this -> slugAttribute } == null ) { $ model -> { $ this -> slugAttribute } = $ transliterationFunction ( $ model -> { $ this -> nameAttribute } ) ; } // if some seo field is empty, filling it with name field data foreach ( $ this -> seoAttributes as $ seoAttribute ) { if ( $ model -> { $ seoAttribute } == null ) { $ model -> { $ seoAttribute } = $ model -> { $ this -> nameAttribute } ; } } }
Slug and seo attributes generating
Slug and seo attributes generating