错别字流程:存储库中的变量
typo3 flow: variable in repository
我想在 typo3 流存储库中使用变量。随着
$letter = $_POST['someVariable'];
它适用于我的以下存储库:
public function findLetter() {
$letter = $_POST['letter'];
$query = $this->createQuery();
$query->matching(
$query->like('name', $letter)
);
return $query->execute();
}
我读到在 typo3 流程中也应该可以通过
获取变量
$letter = $this->request->getArgument('someVariable');
但这对我不起作用;我收到以下错误:
#
1: Notice: Undefined property: ......\Domain\Repository\MitgliedRepository::$request in /var/www/apps/flow/Data/Temporary/Development/Cache/Code/Flow_Object_Classes/..._..._Domain_Repository_...Repository.php line 96
...Repository 中的第 96 行是:
$letter = $this->request->getArgument('letter');
有人知道我做错了什么吗?
我知道了:
我的控制器现在看起来像这样:
/**
* @return void
* @param string $letter
*/
public function letterAction($letter) {
$this->view->assign('mitglieder', $this->mitgliedRepository->findLetter($letter));
}
我的存储库看起来像这样:
/**
* @return string
*/
public function findLetter($letter) {
$query = $this->createQuery();
$query->matching(
$query->like('name', $letter)
)
->setOrderings(array('name' => \TYPO3\Flow\Persistence\QueryInterface::ORDER_ASCENDING));
return $query->execute();
}
我想在 typo3 流存储库中使用变量。随着
$letter = $_POST['someVariable'];
它适用于我的以下存储库:
public function findLetter() {
$letter = $_POST['letter'];
$query = $this->createQuery();
$query->matching(
$query->like('name', $letter)
);
return $query->execute();
}
我读到在 typo3 流程中也应该可以通过
获取变量$letter = $this->request->getArgument('someVariable');
但这对我不起作用;我收到以下错误:
#
1: Notice: Undefined property: ......\Domain\Repository\MitgliedRepository::$request in /var/www/apps/flow/Data/Temporary/Development/Cache/Code/Flow_Object_Classes/..._..._Domain_Repository_...Repository.php line 96
...Repository 中的第 96 行是:
$letter = $this->request->getArgument('letter');
有人知道我做错了什么吗?
我知道了:
我的控制器现在看起来像这样:
/**
* @return void
* @param string $letter
*/
public function letterAction($letter) {
$this->view->assign('mitglieder', $this->mitgliedRepository->findLetter($letter));
}
我的存储库看起来像这样:
/**
* @return string
*/
public function findLetter($letter) {
$query = $this->createQuery();
$query->matching(
$query->like('name', $letter)
)
->setOrderings(array('name' => \TYPO3\Flow\Persistence\QueryInterface::ORDER_ASCENDING));
return $query->execute();
}