简单的例子,我们有
/**
* @ORM\Column(name="api_keyID", type="integer", nullable=false)
*/
private $api_keyID;
/**
* @return integer
*/
public function getApi_keyID()
{
return $this->api_keyID;
}
/**
* @param integer $api_keyID
* @return object
*/
public function setApi_keyID($data)
{
$this->api_keyID = $data;
return $this;
}
查看方法名称和列名称。当我尝试
//...
->findOneByApi_keyID($some);
我收到了像
这样的错误Entity 'entity\path' has no field 'apiKeyID'. You can therefore not call 'findOneByApi_keyID' on the entities' repository
所以教义\ symfony吃下划线? О.о我不能在列名中使用它?
答案 0 :(得分:3)
是出路
$repository->findBy(array('is_enabled' => true));
在这里成立