是否有任何方法在Propel (ORM)中使用匹配语句?
无直接支持。也许是自定义查询?
$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'));
至少在Propel 1.7中,它与where()子句一起工作:
UserQuery::create()->where('MATCH('
. UserPeer::Name
. ') AGAINST(?)', $name)->find();