getMetadataCache(); if (!($this->columns = $cache->get("$table:identity"))) { $table->getQueryExecutor()->execute( new \pq\Query\Writer(IDENTITY_SQL, array($table->getName())), function($result) use($table, $cache) { $this->columns = array_map("current", $result->fetchAll(\pq\Result::FETCH_ARRAY)); $cache->set("$table:identity", $this->columns); } ); } } /** * @implements \Countable * @return int */ function count() { return count($this->columns); } /** * @implements \IteratorAggregate * @return \ArrayIterator */ function getIterator() { return new \ArrayIterator($this->columns); } /** * Get the column names which the primary key contains * @return array */ function getColumns() { return $this->columns; } }