# Source for file Iterator.php

Documentation is available at Iterator.php

1. <?php
2. class Doctrine_Record_Iterator extends ArrayIterator
3. {
4. /**
5. * @var Doctrine_Record $record
6. */
7. private $record;
8. /**
9. * @var Doctrine_Null $null
10. */
11. private static $null;
12. /**
13. * constructor
14. *
15. * @param Doctrine_Record $record
16. */
17. public function __construct(Doctrine_Record $record)
18. {
19. $this->record = $record;
20. parent::__construct($record->getData());
21. }
22. /**
23. * initNullObject
24. *
25. * @param Doctrine_Null $null
26. */
27. public static function initNullObject(Doctrine_Null $null)
28. {
29. self::$null = $null;
30. }
31. /**
32. * current
33. *
34. * @return mixed
35. */
36. public function current()
37. {
38. $value = parent::current();
40. if ($value === self::$null) {
41. return null;
42. } else {
43. return $value;
44. }
45. }
46. }