你怎么能有一个动态宽度风格的harvesthq Chosen下拉菜单?
默认情况下,它具有固定的宽度,如果您尝试使用CSS修改它,您将遇到几个问题以达到良好的结果.
我想做一个DQL查询,如:
$dql = "select p
from AcmeDemoBundle:UserTypeA p
where p.UserTypeB = :id
and (
select top 1 r.boolean
from AcmeDemoBundle:Registry r
)
= true";
Run Code Online (Sandbox Code Playgroud)
但似乎TOP 1它不是doctrine2中的有效函数.
我无法弄清楚如何将子查询的结果限制为一行.
我将简化我的代码,我接下来会:
医生实体:
use ...\...\Entity\Paciente;
class Doctor extends Usuario {
public function __construct() {
...
$this->pacientes = new ArrayCollection();
...
}
/**
* Número de colegiado - numColegiado
*
* @var string
*
* @ORM\Column(name="numColegiado", type="string", length=255, unique=true)
*/
protected $numColegiado;
/**
* @ORM\OneToMany(targetEntity="Paciente", mappedBy="doctor")
* @var \Doctrine\Common\Collections\ArrayCollection
*/
private $pacientes;
...
}
Run Code Online (Sandbox Code Playgroud)
Paciente实体:
use \...\...\Entity\Doctor;
...
class Paciente extends Usuario {
}
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\ManyToOne(targetEntity="Doctor", inversedBy="pacientes")
* @ORM\JoinColumn(name="doctorNum", referencedColumnName="numColegiado", nullable=TRUE) …Run Code Online (Sandbox Code Playgroud)