[TYPO3-50-general] understanding the AOP implementation

Peter Niederlag niederlag at ikd01.de
Thu Jul 17 11:35:24 CEST 2008


Hi,

Robert Lemke schrieb:
> Hi Peter,
> 
> Am 17.07.2008 um 11:03 schrieb Peter Niederlag:
[...]
> For example you could define a named pointcut "TypoScriptObjects" which
> matches all classes implementing the TypoScript Interface:
> 
> class F3_Peter_SomeAspect {
> 
>    /**
>     * @pointcut within(F3_TypoScript_TypoScriptObjectInterface)
>     */
>     protected $typoScriptObjects;
> ...

I thought named pointcuts use function declarations as names? Which IMO
is kind of very hard to understand/ a little weird. :-< variable
declarations as name for the pointcut seems to be more appropriate to me.

> Then you want implement an advice which intercepts the render method of
> all TypoScript objects:
> 
> /**
>  * @around method(.*->render()) && F3_Peter_SomeAspect->typoScriptObjects
>  */
> public function renderAdvice(F3_FLOW3_AOP_JoinPointInterface $joinPoint) {
>    $originalRenderOutput =
> $joinPoint->getAdviceChain()->proceed($joinPoint);
>    return $originalRenderOutput . ' - Peter was here.';
> }
> 
> You see?

Yes, now I am sure I see the right stuff. ;)

Greets,
Peter
-- 
Peter Niederlag
http://www.niekom.de * TYPO3 & EDV Dienstleistungen *
http://www.typo3partner.net * professional services network *


More information about the TYPO3-project-5_0-general mailing list