相关疑难解决方法(0)

在Doctrine\ORM\PersistentCollection中定义自定义方法

我正在获取具有多对多关系的数据,并且我想定义acustom方法.有可能(以及如何)使用类似的东西:

$hotel = $entityManager->getRepository('Hotels')->findOneById(1);
$types = $hotel->getTypes(); //$types is instance of **Doctrine\ORM\PersistentCollection**
$types->myCustomFunction(); //do something
Run Code Online (Sandbox Code Playgroud)

php doctrine doctrine-orm

5
推荐指数
1
解决办法
1124
查看次数

标签 统计

doctrine ×1

doctrine-orm ×1

php ×1