Created
July 17, 2013 18:14
-
-
Save dfeyer/6023012 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Ttree\Medialib\Core\Domain\Repository\Aspect; | |
/* * | |
* This script belongs to the FLOW3 package "Ttree.Medialib". * | |
* * | |
* */ | |
use Ttree\Medialib\Core\Exception; | |
use TYPO3\Flow\Annotations as Flow; | |
/** | |
* @Flow\Aspect | |
* @Flow\Scope("singleton") | |
*/ | |
class AccountRepositoryAspect { | |
/** | |
* @Flow\Inject | |
* @var \Ttree\Medialib\Core\Domain\Repository\AccountRepository | |
*/ | |
protected $accountRepository; | |
/** | |
* @Flow\Around("class(TYPO3\Flow\Security\AccountRepository)") | |
* @param \TYPO3\Flow\Aop\JoinPointInterface $joinPoint | |
* @return mixed | |
* @throws \Ttree\Medialib\Core\Exception | |
*/ | |
public function proxyAllMethods(\TYPO3\Flow\Aop\JoinPointInterface $joinPoint) { | |
if (!method_exists($this->accountRepository, $joinPoint->getMethodName())) { | |
throw new Exception(sprintf('Method (%s) not found', 1374082407)); | |
} | |
return call_user_func_array(array($this->accountRepository, $joinPoint->getMethodName()), $joinPoint->getMethodArguments()); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can AOP around $this->persistenceManager->createQueryForType($this->entityClassName);