Project

General

Profile

Actions

Bug #61995

closed

Extbase: Overwriting objects by TS not working in CommandController?

Added by Vitoandre D'Oria over 9 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Extbase
Target version:
Start date:
2014-10-01
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.3
Tags:
Complexity:
medium
Is Regression:
No
Sprint Focus:

Description

plugin.tx_ext {
    objects {
        TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface {
            className = MY\Ext\Configuration\ConfigurationManager
        }
        TYPO3\CMS\Extbase\Configuration\BackendConfigurationManager {
            className = MY\Ext\Configuration\BackendConfigurationManager
        }
    }
}
module.tx_ext < plugin.tx_ext

    MyCommand($pid) {
        $this->configurationManager = $this->objectManager->get('\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface');
        $this->configurationManager->setCurrentPageId($pid);
    }

I also got the following questions:
1.) Why aren't we able to change the pid in BE? For Tasks its possible to obtain a pid but since you initially set this value we are not able to just do $_POST['id'] = $pid; afterwards. Neither we are able to overwrite the pid.

2.) Documentation of this objects Syntax is not existing? I just found some old config.tx_extbase example blogs and the code here: https://review.typo3.org/#/c/16855/4/Classes/Core/Bootstrap.php makes no sense (at least to me).
Why $classNameWithDot ???

From \TYPO3\CMS\Extbase\Object\Container\Container i would guess i have to overwrite the interface instead the concrete class!? Does this make a difference (in both cases its not working for me)?:


    /**
     * register a classname that should be used if a dependency is required.
     * e.g. used to define default class for a interface
     *
     * @param string $className
     * @param string $alternativeClassName
     */
    public function registerImplementation($className, $alternativeClassName) {
        $this->alternativeImplementation[$className] = $alternativeClassName;
    }

Hope someone explains that feature or points me to a wiki? page that isn't completely outdated. I also wouldn't mind it if the source code was better documented e.g. samples like the one given here :-)

ps. does this feature also have a official name? Searching for className, objects TypoScript isn't that great.


Related issues 2 (0 open2 closed)

Is duplicate of TYPO3 Core - Bug #60296: Task executor ignores full framework configurationClosedMathias Brodala2014-07-14

Actions
Is duplicate of TYPO3 Core - Bug #60381: Local object configuration ignored in CLI contextClosedMathias Brodala2014-07-18

Actions
Actions

Also available in: Atom PDF