protected function _modifyBelongsTo(Event $event)
    {
        $belongsTo = $event->subject->viewVars['associations']['belongsTo'];

        foreach ($belongsTo as $i => $association) {
            if ($association['alias'] !== 'Versions' || $association['foreignKey'] !== 'version_id') {
                continue;
            }

            unset($belongsTo[$i]);
        }

        return $belongsTo;
    }
protected function _modifyBelongsTo(Event $event)
    {
        $belongsTo = $event->subject->viewVars['associations']['belongsTo'];

        foreach ($belongsTo as $i => $association) {
            if ($association['alias'] !== 'Versions' || $association['foreignKey'] !== 'version_id') {
                continue;
            }

            unset($belongsTo[$i]);
        }

        return $belongsTo;
    }
protected function _modifyBelongsTo ( Event $ event ) { $ belongsTo = $ event -> subject -> viewVars [ 'associations' ] [ 'belongsTo' ] ; foreach ( $ belongsTo as $ i => $ association ) { if ( $ association [ 'alias' ] !== 'Versions' || $ association [ 'foreignKey' ] !== 'version_id' ) { continue ; } unset ( $ belongsTo [ $ i ] ) ; } return $ belongsTo ; }
Removes unnecessary belongsTo associations

@param Event $event An Event instance
@return array
Removes unnecessary belongsTo associations