Is there any way of using match against statement in Propel (ORM)?

流过昼夜 提交于 2019-12-24 10:37:34

问题


Is there any way of using match against statement in Propel (ORM)? It is odd I cannot find anything related to this.


回答1:


No direct support. Perhaps a custom query?

$con = Propel::getConnection(BookPeer::DATABASE_NAME);
$sql = "SELECT title,category FROM articles WHERE MATCH(title,category) AGAINST (:text); 
$stmt = $con->prepare($sql);
$stmt->execute(array(':text' => 'My match text'));



回答2:


At least in Propel 1.7 it works with a where() clause:

UserQuery::create()->where('MATCH('
. UserPeer::Name
. ') AGAINST(?)', $name)->find();


来源:https://stackoverflow.com/questions/8655710/is-there-any-way-of-using-match-against-statement-in-propel-orm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!