/** * Returns the name of the PRIMARY KEY column. * @return string|null */ public function getPrimaryKey() { $table = $this->getTable(); if (!$table) { return null; } $key = null; $cached = $this->connection->getCache()->fetch($table . '_primaryKey'); if ($cached === null) { try { $key = $this->connection->getDriver()->getPrimaryKey($table, isset($this->resultSet) ? $this->resultSet : null); } catch (NeevoException $e) { return null; } $this->connection->getCache()->store($table . '_primaryKey', $key); return $key === '' ? null : $key; } return $cached === '' ? null : $cached; }
public function testAutoSetCache() { $this->assertInstanceOf('Neevo\\Cache\\MemoryStorage', $this->instance->getCache()); }