簡體   English   中英

獲取TYPO3 Flow中用於查詢的實體的表名

[英]Get table name of an entity for a query in TYPO3 Flow

有人知道如何獲取存儲庫類中實體的表名嗎? 使用Extbase,這似乎很容易實現,但是我在TYPO3 Flow中找不到任何輔助類。 對於實體存儲庫中的原始SQL查詢,我需要這樣做。

RTFM: http : //wiki.typo3.org/Flow_Cookbook#Execute_arbitrary_DQL 因此,使用DQL,我可以直接在查詢中使用類名。

/**
 * @Flow\Inject
 * @var \Doctrine\Common\Persistence\ObjectManager
 */
protected $entityManager;

[...]

$dql = 'SELECT COUNT(e) FROM Vendor\Package\Domain\Model\Entity e WHERE e.property = :property';

$query = $this->entityManager->createQuery($dql);
$query->setParameters(array('property' => $property));
$result = $query->execute();

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM