Discussion:
[TYPO3-english] Typo3 cms 7.1 - makeInstance of persistenceManager
Vikram Mandal
2015-02-27 10:42:25 UTC
Permalink
Hi,

For some reason i need a instance of persistenceManager.. i have no choice.

Now I am not able to get an instance of Tx_Extbase_Persistence_Manager
in Typo3 7.1

---------------
$persistenceManager =
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_Extbase_Persistence_Manager');

Fatal error: Class 'Tx_Extbase_Persistence_Manager' not found

----other many more trials failed too --------
$persistenceManager =
$this->objectManager->get('Tx_Extbase_Persistence_Manager');

$persistenceManager =
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Persistence\\PersistenceManager');

$persistenceManager =
$this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager::class);


---------
I even tried with injecting the PersistenceManager but still highly
unsuccessful!!

Would be thankful if any one could give me some pointer/ideas.
--
regards
Vikram Mandal
--
FiveE Technologies.
http://FiveEtechnologies.com
Jan Bednarik
2015-02-27 13:28:57 UTC
Permalink
Hi Vikram,

/**
* @deprecated since 6.0 will be removed in 7.0
*/
class Tx_Extbase_Persistence_Manager extends
\TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager {}

I think the best way would be to inject:

/**
* persistenceManager
*
* @var \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager
* @inject
*/
protected $persistenceManager;


Jan
Post by Vikram Mandal
Hi,
For some reason i need a instance of persistenceManager.. i have no choice.
Now I am not able to get an instance of Tx_Extbase_Persistence_Manager
in Typo3 7.1
---------------
$persistenceManager =
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_Extbase_Persistence_Manager');
Fatal error: Class 'Tx_Extbase_Persistence_Manager' not found
----other many more trials failed too --------
$persistenceManager =
$this->objectManager->get('Tx_Extbase_Persistence_Manager');
$persistenceManager =
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Persistence\\PersistenceManager');
$persistenceManager =
$this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager::class);
---------
I even tried with injecting the PersistenceManager but still highly
unsuccessful!!
Would be thankful if any one could give me some pointer/ideas.
Vikram Mandal
2015-02-28 04:40:15 UTC
Permalink
Hi Jan,

I tried this too. It did not work.

May be I would not need persistence any more as certain things which
were not working in 7.0 have started to work in 7.1

Thanks anyway.
- Vikram
Post by Jan Bednarik
Hi Vikram,
/**
*/
class Tx_Extbase_Persistence_Manager extends
\TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager {}
/**
* persistenceManager
*
*/
protected $persistenceManager;
Jan
Post by Vikram Mandal
Hi,
For some reason i need a instance of persistenceManager.. i have no choice.
Now I am not able to get an instance of Tx_Extbase_Persistence_Manager
in Typo3 7.1
---------------
$persistenceManager =
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_Extbase_Persistence_Manager');
Fatal error: Class 'Tx_Extbase_Persistence_Manager' not found
----other many more trials failed too --------
$persistenceManager =
$this->objectManager->get('Tx_Extbase_Persistence_Manager');
$persistenceManager =
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Persistence\\PersistenceManager');
$persistenceManager =
$this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager::class);
---------
I even tried with injecting the PersistenceManager but still highly
unsuccessful!!
Would be thankful if any one could give me some pointer/ideas.
--
regards
Vikram Mandal
--
FiveE Technologies.
http://FiveEtechnologies.com
Jigal van Hemert
2015-02-27 14:16:27 UTC
Permalink
Hi,
Post by Vikram Mandal
For some reason i need a instance of persistenceManager.. i have no choice.
Now I am not able to get an instance of Tx_Extbase_Persistence_Manager
in Typo3 7.1
---------------
$persistenceManager =
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_Extbase_Persistence_Manager');
The class is currently known as
TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager. The old class
names can be used if you install the system extension "compatibility6",
but it'll most likely cost you quite a bit of performance.

If the objectManager can't give it to you makeInstance probably will.
--
Jigal van Hemert
TYPO3 CMS Active Contributor

TYPO3 .... inspiring people to share!
Get involved: typo3.org
Vikram Mandal
2015-02-28 04:43:08 UTC
Permalink
Hi Jigal,

Thank you for the info.
Post by Jigal van Hemert
Hi,
Post by Vikram Mandal
For some reason i need a instance of persistenceManager.. i have no choice.
Now I am not able to get an instance of Tx_Extbase_Persistence_Manager
in Typo3 7.1
---------------
$persistenceManager =
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_Extbase_Persistence_Manager');
The class is currently known as
TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager. The old class
names can be used if you install the system extension "compatibility6",
but it'll most likely cost you quite a bit of performance.
If the objectManager can't give it to you makeInstance probably will.
--
regards
Vikram Mandal
--
FiveE Technologies.
http://FiveEtechnologies.com
Loading...