ユーザーにメッセージを表示するために、Doctrine クエリの結果が空であるか、値がないかを確認する正しい方法はどれですか? 私はこのコードを持っています:
public function executeIndex(sfWebRequest $request) {
$this->sdriving_emisors = Doctrine_Core::getTable('SdrivingEmisor')->createQuery('a')->execute();
}
そして、私の見解では、次のようにチェックしています。
<?php if (!empty($sdriving_emisors)): ?>
// show records
<?php else: ?>
// show message
<?php endif; ?>
しかし、$sdriving_emisors
常にコンテンツがあるため機能しません。PS: Symfony 1.4.20 で作業しています