Zend framework 如何在doctriemodule的ObjectSelect条件参数中设置变量
我想知道如何在ObjectSelect条件参数中设置变量。 我的代码如下:Zend framework 如何在doctriemodule的ObjectSelect条件参数中设置变量,zend-framework,doctrine-orm,Zend Framework,Doctrine Orm,我想知道如何在ObjectSelect条件参数中设置变量。 我的代码如下: $this->add( array( 'type' => 'DoctrineModule\Form\Element\ObjectSelect', 'name' => 'shop', 'attributes' => array( 'class' => 'chosen-select form-control' ),
$this->add(
array(
'type' => 'DoctrineModule\Form\Element\ObjectSelect',
'name' => 'shop',
'attributes' => array(
'class' => 'chosen-select form-control'
),
'options' => array(
'object_manager' => $this->objectManager,
'target_class' => '\Godana\Entity\Shop',
'property' => 'name',
'label' => 'Shop',
'label_attributes' => array(
'class' => 'col-sm-3 control-label',
),
'find_method' => array(
'name' => 'findBy',
'params' => array(
'criteria' => array('owner' => $this->shopOwner),
),
),
),
)
);
它返回空值,但如果我使用静态值,如'criteria'=>array('owner'=>1),它将从我的数据库返回数据。它不应该是$this->shopOwner->getId()