Extbase Model: setSysLanguageUid not working

后端 未结 1 971
醉酒成梦
醉酒成梦 2021-01-17 02:10

I created an extbase model and try to set the sys_language_uid field when creating a new item. For some reason though, it is completely ignored and always set to 0, even whe

1条回答
  •  粉色の甜心
    2021-01-17 03:00

    it seems like setSysLanguageUid doesn't work because typo3 is UNNECESSARILY CONVOLUTED AND DIFFICULT. For some reason it is possible to set the language ID but only by defining and using these getters and setters:

    /**
     * _languageUid
     * @var int
     */
    protected $_languageUid;
    
    /**
     * @param int $_languageUid
     * @return void
     */
    public function set_languageUid($_languageUid) {
        $this->_languageUid = $_languageUid;
    }
    
    /**
     * @return int
     */
    public function get_languageUid() {
        return $this->_languageUid;
    }
    

    I swear, typo3 is gonna give me a heart attack one of these days....

    0 讨论(0)
提交回复
热议问题