有人能告诉我这段代码有什么问题吗?
$em = $this->getEntityManager();
$dql = <<<DQL
SELECT of, f, s
FROM MyBundle:OrgFeatures of
INNER JOIN of.feature f
INNER JOIN MyBundle:FeatureMasterLang s WITH s.featureMaster=f.id
WHERE of.orgPermissionset = :permissionsetId AND
s.lang = 1 AND
of.feature IN(:featureIds)
DQL;
$query = $em->createQuery($dql)
->setParameter('permissionsetId', $permissionsetId)
->setParameter('featureIds', $featureIds);
$resultSet = $query->getResult(\Doctrine\ORM\AbstractQuery::HYDRATE_ARRAY);
输出:
Array
(
[0] => Array
(
[id] => 141
[privateCreate] => 1
[publicView] => 1
[feature] => Array
(
[createdAt] =>
[modifiedAt] =>
[deletedAt] =>
[id] => 1
)
)
[1] => Array
(
[id] => 1
[featureName] => Referrals
)
)
)
我需要将数组作为一个元素而不是两个,featureName
数组中的[feature]
。这可能吗?