1
0
mirror of synced 2025-02-20 22:23:14 +03:00
doctrine2/lib/Doctrine/Record/Iterator.php

43 lines
909 B
PHP
Raw Normal View History

2006-06-01 11:58:05 +00:00
<?php
class Doctrine_Record_Iterator extends ArrayIterator {
/**
* @var Doctrine_Record $record
*/
private $record;
/**
* @var Doctrine_Null $null
*/
private static $null;
/**
* constructor
*
* @param Doctrine_Record $record
*/
public function __construct(Doctrine_Record $record) {
$this->record = $record;
parent::__construct($record->getData());
}
/**
* initNullObject
*
* @param Doctrine_Null $null
*/
public static function initNullObject(Doctrine_Null $null) {
self::$null = $null;
}
/**
* current
*
* @return mixed
*/
public function current() {
$value = parent::current();
2006-12-29 14:01:31 +00:00
if ($value === self::$null) {
2006-06-01 11:58:05 +00:00
return null;
2006-12-29 14:01:31 +00:00
} else {
2006-06-01 11:58:05 +00:00
return $value;
2006-12-29 14:01:31 +00:00
}
2006-06-01 11:58:05 +00:00
}
}