Skip to content

Instantly share code, notes, and snippets.

@dfeyer
Created July 17, 2013 18:14
Show Gist options
  • Save dfeyer/6023012 to your computer and use it in GitHub Desktop.
Save dfeyer/6023012 to your computer and use it in GitHub Desktop.
<?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());
}
}
?>
@Akii
Copy link

Akii commented Jul 17, 2013

You can AOP around $this->persistenceManager->createQueryForType($this->entityClassName);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment