1 # ArrayIterator pq\Gateway\Table\Attributes::getIterator()
3 Implements IteratorAggregate.
11 ArrayIterator, columnd list (indexed by column number **and** name).
19 class ColNameIterator extends FilterIterator {
20 public function __construct(Table\Attributes $attrs) {
21 parent::__construct($attrs->getIterator());
23 public function accept() {
24 return !is_numeric($this->key());
28 $table = new pq\Gateway\Table("account");
29 $attrs = $table->getAttributes();
30 foreach (new ColNameIterator($attrs) as $col => $att) {
31 printf("%10s: %s\n", $col, http_build_query($att, null, ", "));
38 id: index=1, name=id, type=2950, hasdefault=1, nullable=0
39 password: index=2, name=password, type=1042, hasdefault=0, nullable=1
40 name: index=3, name=name, type=1043, hasdefault=0, nullable=1