---
title: "Aspect-Oriented Programming return value"
url: "https://www.typo3.net/d/116633-aspect-oriented-programming-return-value"
source: "typo3.net"
tags: ["Archiv","Flow","Frage"]
created: "2013-11-19"
last_reply: "2013-11-19"
replies: 0
solved: false
page: 1
pages: 1
lang: "de"
---

# Aspect-Oriented Programming return value

Archiv › Flow · 0 Antworten · gestartet 2013-11-19

## Eröffnungsbeitrag

**curi0u5** · 2013-11-19 · [Beitrag #1](https://www.typo3.net/d/116633-aspect-oriented-programming-return-value/1)

Gibt es eine Möglichkeit per AOP einen Wert in der Methode der Zielklasse zurückzugeben????

Ein Beispiel:
Nach dem Logging soll z.B. ein Value zurückgegeben werden.

```php
namespace Examples\Forum\Logging;

/**
 * @Flow\Aspect
 */
class LoggingAspect {

        /**
         * @Flow\Inject
         * @var \Examples\Forum\Logger\ApplicationLoggerInterface
         */
        protected $applicationLogger;

        /**
         * Log a message if a post is deleted
         *
         * @param \TYPO3\Flow\AOP\JoinPointInterface $joinPoint
         * @Flow\Before("method(Examples\Forum\Domain\Model\Forum->deletePost())")
         * @return void
         */
        public function logDeletePost(\TYPO3\Flow\AOP\JoinPointInterface $joinPoint) {
                $post = $joinPoint->getMethodArgument('post');
                $this->applicationLogger->log('Removing post ' . $post->getTitle(), LOG_INFO);
        }

}
```

---

Quelle: „Aspect-Oriented Programming return value“, typo3.net, https://www.typo3.net/d/116633-aspect-oriented-programming-return-value
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
