library/Garp/Model/Behavior/Sluggable.php
protected function _addSlugFromMultiple(Garp_Model_Db $model, array &$targetData, array $referenceData) {
        $baseFields = $this->_config['baseField'];
        $slugField  = $this->_config['slugField'][0];
        $baseData = array();
        if (!empty($targetData[$slugField])) {
            return;
        }
        $lang = null;
        if (isset($referenceData[Garp_Model_Behavior_Translatable::LANG_COLUMN])) {
            $lang = $referenceData[Garp_Model_Behavior_Translatable::LANG_COLUMN];
        }
        foreach ((array)$baseFields as $baseColumn) {
            $baseData[] = $this->_getBaseString($baseColumn, $referenceData);
        }
        $baseData = implode(' ', $baseData);
        $targetData[$slugField] = $this->generateUniqueSlug($baseData, $model, $slugField, $lang);
    }
protected function _addSlugFromMultiple(Garp_Model_Db $model, array &$targetData, array $referenceData) {
        $baseFields = $this->_config['baseField'];
        $slugField  = $this->_config['slugField'][0];
        $baseData = array();
        if (!empty($targetData[$slugField])) {
            return;
        }
        $lang = null;
        if (isset($referenceData[Garp_Model_Behavior_Translatable::LANG_COLUMN])) {
            $lang = $referenceData[Garp_Model_Behavior_Translatable::LANG_COLUMN];
        }
        foreach ((array)$baseFields as $baseColumn) {
            $baseData[] = $this->_getBaseString($baseColumn, $referenceData);
        }
        $baseData = implode(' ', $baseData);
        $targetData[$slugField] = $this->generateUniqueSlug($baseData, $model, $slugField, $lang);
    }
protected function _addSlugFromMultiple ( Garp_Model_Db $ model , array & $ targetData , array $ referenceData ) { $ baseFields = $ this -> _config [ 'baseField' ] ; $ slugField = $ this -> _config [ 'slugField' ] [ 0 ] ; $ baseData = array ( ) ; if ( ! empty ( $ targetData [ $ slugField ] ) ) { return ; } $ lang = null ; if ( isset ( $ referenceData [ Garp_Model_Behavior_Translatable :: LANG_COLUMN ] ) ) { $ lang = $ referenceData [ Garp_Model_Behavior_Translatable :: LANG_COLUMN ] ; } foreach ( ( array ) $ baseFields as $ baseColumn ) { $ baseData [ ] = $ this -> _getBaseString ( $ baseColumn , $ referenceData ) ; } $ baseData = implode ( ' ' , $ baseData ) ; $ targetData [ $ slugField ] = $ this -> generateUniqueSlug ( $ baseData , $ model , $ slugField , $ lang ) ; }
Add single slug from multiple sources
@param Garp_Model_Db $model
@param Array $data Data that will be inserted: should receive the slug
@param Array $referenceData Data to base the slug on
@return Void
Add single slug from multiple sources