问题
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