Doctrine에서 나는 execute 또는 toArray() 대신 fetchArray() 함수를 사용할 수 있습니다. 나는 Propel에 대해 이러한 기능을 찾을 수 없다. 이것이 가능한가? 당신이 정말로 배열을 필요로하는 경우Propel - fetchArray 또는 toArray
0
A
답변
2
당신이 할 수처럼 설정 추진 결과를 반복 할 수
$criteria = new Criteria();
/* ...setup your criteria... */
$pdoStatement = AuthorPeer::doSelectStmt($criteria);
$array = $pdoStatement->fetchAll(PDO::FETCH_ASSOC);
0
당신은 당신이 예전 피어 API를 사용할 수있는 배열
$authors = AuthorQuery::create()
->limit(5)
->find();
foreach ($authors as $author) {
echo $authors->getFirstName();
}
http://www.propelorm.org/documentation/03-basic-crud.html#collections_and_ondemand_hydration
1
당신에게 ->find()
바로 뒤에 toArray()
으로 전화 할 수 있습니다. 한 번에
다음 중 하나를
$authors = AuthorQuery::create()
->limit(5)
->find()l
foreach ($authors as $author) {
print_r($author->toArray());
}
:
$authors = AuthorQuery::create()
->limit(5)
->find()
->toArray();
foreach ($authors as $author) {
print_r($author);
}
또는 루프에서
관련 문제
- 1. fetchArray()
- 2. Generics, ToArray etc.
- 3. Propel 쿼리 버그 또는 재사용 재사용?
- 4. Symfony - Propel - 현재 버전의 propel 결정
- 5. PyMongo 및 toArray() 메소드
- 6. 집합의 "toArray"가 결정적입니까?
- 7. Schema.xml로 Propel
- 8. Symfony, propel, question mark
- 9. ToArray() 구현을 어떻게 최적화 했습니까?
- 10. F #을 사용하는 HashSet`.ToArray()`#
- 11. Ember.js toArray 방법 예상 결과
- 12. propel 1.5.2의 상속 문제
- 13. Propel - checking date
- 14. Symfony 1.4에서 Propel 사용하기
- 15. Propel 컬렉션 필터링
- 16. Propel 자동 양식
- 17. Propel 및 영구 연결
- 18. propel equivalent of "exists"
- 19. OR 예제 문장 PROPEL
- 20. Doctrine to Propel snippet
- 21. Propel - 병합 컬렉션
- 22. Zend_Form Propel 객체 생성
- 23. 다중 결합 - Propel
- 24. Propel 1.6 Formatter
- 25. symfony propel addAnd
- 26. symfony1.4에서 Propel 또는 Doctrine없이 Db를 연결할 수 있습니까?
- 27. propel 캐시 지우기 (인스턴스 풀)
- 28. LINQ to Entities가 'System.String [] ToArray [String]
- 29. Propel 1.6 - 질문 정보 포함
- 30. Propel ORM : 열의 평균 계산