Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TYPO3 Extbase storagePid

Tags:

typo3

extbase

I need to get the actual "general record storage page id". I found the following snipplet but the variable is empty even though the storagePid is set on the page.

$config = $this->configurationManager->getConfiguration(Tx_Extbase_Configuration_ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
var_dump($config['persistence']['storagePid']);

Any help would be appreciated

like image 257
netcase Avatar asked Dec 28 '22 00:12

netcase


1 Answers

I'm not quite sure, what are you trying to get. Snippet you provided gets without problems the storagePid set in constants for your extension, the same as this code from setup.txt:

plugin.tx_yourext {
    persistence {
        storagePid = {$plugin.tx_yourext.persistence.storagePid}
    }
}

if you have problems with getting your storagePid with provided snippet also can modify your setup.txt and make sure that the value will be also propagated into settings scope:

plugin.tx_yourext {
    persistence {
        storagePid = {$plugin.tx_yourext.persistence.storagePid}
    }
    settings {
        storagePid = {$plugin.tx_yourext.persistence.storagePid}
    }
}

then in your controller you can catch it with simpler code:

$myStoragePid = $this->settings['storagePid'];

if it will not work for you that means, you didn't set proper value in Constants for YourExt and/or didn't cleared the caches in the BE.

BTW: Maybe if you'll be more specific I could send better answer.

like image 191
biesior Avatar answered Dec 29 '22 14:12

biesior