我的代码是
public function index() {
$user = $this->doctrine->em->find('user\models\User', 1);
echo '<br>';
echo $user->getName();
}
输出
SELECT t0.id AS id1, t0.name AS name2 FROM tbl_user t0 WHERE t0.id = ? array(1) { [0]=> int(1) } array(1) { [0]=> string(7) "integer" }
约翰
我使用过CodeIgniter 2.2.2并使用这些步骤整合了原则link