image我有以下数据库结构
class voters
{
protected $voterid;
protected $imageid;
protected $action;
}
// $voterid = is the current voter
// $imageid = is the id of the voted image
// $action = is upvote/downvote,delete
Run Code Online (Sandbox Code Playgroud)
如果我想一次查找几个项目,检查列是否存在,会发生什么
$dummy = findOneBy('voterid'=>1,'imageid'=>2,action=>"upvote");
if($dummy)
{
//column exists!
}
Run Code Online (Sandbox Code Playgroud)
这可能吗?
我需要在释放滑块时调用函数,"onchange"会在更改时更改值.这有解决方案吗?
像这样
<input type="range" min="0" max="1000" onrelease="callfunction()">
Run Code Online (Sandbox Code Playgroud) 我试图像这样返回用户,但当然它不起作用,我需要数据作为JSon,因为我正在使用BackboneJs
/**
* @Route("/mytest",name="ajax_user_path")
*/
public function ajaxAction()
{
$em = $this->get('doctrine')->getManager();
$users = $this->get('doctrine')->getRepository('GabrielUserBundle:Fosuser')->findAll();
$response = array("users"=>$users);
return new Response(json_encode($response));
}
Run Code Online (Sandbox Code Playgroud)