diff --git a/examples/database-reflection.php b/examples/database-reflection.php
index ba6a7bf0..73f40ebf 100644
--- a/examples/database-reflection.php
+++ b/examples/database-reflection.php
@@ -16,10 +16,10 @@ dibi::connect([
// retrieve database reflection
$database = dibi::getDatabaseInfo();
-echo "
Database '{$database->name}'
\n";
+echo "Database '{$database->getName()}'
\n";
echo "\n";
foreach ($database->getTables() as $table) {
- echo '- ', ($table->view ? 'view' : 'table') . " $table->name
\n";
+ echo '- ', ($table->isView() ? 'view' : 'table') . " {$table->getName()}
\n";
}
echo "
\n";
@@ -27,12 +27,12 @@ echo "\n";
// table reflection
$table = $database->getTable('products');
-echo "Table '{$table->name}'
\n";
+echo "Table '{$table->getName()}'
\n";
echo "Columns\n";
echo "\n";
foreach ($table->getColumns() as $column) {
- echo "- {$column->name} {$column->nativeType}
{$column->default}
\n";
+ echo "- {$column->getName()} {$column->getNativeType()}
{$column->getDefault()}
\n";
}
echo "
\n";
@@ -40,9 +40,9 @@ echo "\n";
echo 'Indexes';
echo "\n";
foreach ($table->getIndexes() as $index) {
- echo "- {$index->name} " . ($index->primary ? 'primary ' : '') . ($index->unique ? 'unique' : '') . ' (';
+ echo "
- {$index->getName()} " . ($index->isPrimary() ? 'primary ' : '') . ($index->isUnique() ? 'unique' : '') . ' (';
foreach ($index->getColumns() as $column) {
- echo "$column->name, ";
+ echo $column->getName(), ', ';
}
echo ")
\n";
}
diff --git a/src/Dibi/Drivers/FirebirdDriver.php b/src/Dibi/Drivers/FirebirdDriver.php
index 633d968b..33dc4287 100644
--- a/src/Dibi/Drivers/FirebirdDriver.php
+++ b/src/Dibi/Drivers/FirebirdDriver.php
@@ -163,7 +163,7 @@ class DibiFirebirdDriver extends DibiObject implements IDibiDriver, IDibiResultD
if ($savepoint !== NULL) {
throw new DibiNotSupportedException('Savepoints are not supported in Firebird/Interbase.');
}
- $this->transaction = ibase_trans($this->resource);
+ $this->transaction = ibase_trans($this->getResource());
$this->inTransaction = TRUE;
}
diff --git a/src/Dibi/Drivers/PostgreDriver.php b/src/Dibi/Drivers/PostgreDriver.php
index a2f404b0..a21bbb92 100644
--- a/src/Dibi/Drivers/PostgreDriver.php
+++ b/src/Dibi/Drivers/PostgreDriver.php
@@ -459,7 +459,7 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver, IDibiResultDr
*/
public function getTables()
{
- $version = pg_parameter_status($this->resource, 'server_version');
+ $version = pg_parameter_status($this->getResource(), 'server_version');
if ($version < 7.4) {
throw new DibiDriverException('Reflection requires PostgreSQL 7.4 and newer.');
}
diff --git a/tests/dibi/Result.meta.phpt b/tests/dibi/Result.meta.phpt
index 06cd250e..9e978d9a 100644
--- a/tests/dibi/Result.meta.phpt
+++ b/tests/dibi/Result.meta.phpt
@@ -39,19 +39,19 @@ if ($config['driver'] !== 'sqlite3' && $config['driver'] !== 'pdo') {
$columns = $info->getColumns();
-Assert::same('product_id', $columns[0]->name);
+Assert::same('product_id', $columns[0]->getName());
if ($config['driver'] !== 'sqlite3' && $config['driver'] !== 'pdo') {
- Assert::same('products', $columns[0]->tableName);
+ Assert::same('products', $columns[0]->getTableName());
}
Assert::null($columns[0]->getVendorInfo('xxx'));
if ($config['system'] !== 'sqlite') {
- Assert::same('i', $columns[0]->type);
+ Assert::same('i', $columns[0]->getType());
}
-Assert::null($columns[0]->nullable);
+Assert::null($columns[0]->isNullable());
-Assert::same('xxx', $columns[3]->name);
-Assert::null($columns[3]->tableName);
+Assert::same('xxx', $columns[3]->getName());
+Assert::null($columns[3]->getTableName());
if ($config['system'] !== 'sqlite') {
- Assert::same('i', $columns[0]->type);
+ Assert::same('i', $columns[0]->getType());
}
-Assert::null($columns[3]->nullable);
+Assert::null($columns[3]->isNullable());
diff --git a/tests/dibi/meta.phpt b/tests/dibi/meta.phpt
index 70bef32b..12479a2c 100644
--- a/tests/dibi/meta.phpt
+++ b/tests/dibi/meta.phpt
@@ -27,32 +27,32 @@ Assert::equal(['customers', 'orders', 'products'], $names);
Assert::false($meta->hasTable('xxxx'));
$table = $meta->getTable('products');
-Assert::same('products', $table->name);
+Assert::same('products', $table->getName());
Assert::false($table->isView());
Assert::same(2, count($table->getColumns()));
Assert::false($table->hasColumn('xxxx'));
Assert::true($table->hasColumn('product_id'));
Assert::true($table->hasColumn('Product_id'));
-Assert::same('product_id', $table->getColumn('Product_id')->name);
+Assert::same('product_id', $table->getColumn('Product_id')->getName());
$column = $table->getColumn('product_id');
-Assert::same('product_id', $column->name);
-Assert::same('products', $column->table->name);
-Assert::same('i', $column->type);
-Assert::type('string', $column->nativeType);
-Assert::false($column->nullable);
-Assert::true($column->autoIncrement);
+Assert::same('product_id', $column->getName());
+Assert::same('products', $column->getTable()->getName());
+Assert::same('i', $column->getType());
+Assert::type('string', $column->getNativeType());
+Assert::false($column->isNullable());
+Assert::true($column->isAutoIncrement());
$column = $table->getColumn('title');
-Assert::same('title', $column->name);
-Assert::same('products', $column->table->name);
-Assert::same('s', $column->type);
-Assert::type('string', $column->nativeType);
-Assert::same(100, $column->size);
-Assert::true($column->nullable);
-Assert::false($column->autoIncrement);
-//Assert::null($column->default);
+Assert::same('title', $column->getName());
+Assert::same('products', $column->getTable()->getName());
+Assert::same('s', $column->getType());
+Assert::type('string', $column->getNativeType());
+Assert::same(100, $column->getSize());
+Assert::true($column->isNullable());
+Assert::false($column->isAutoIncrement());
+//Assert::null($column->getDefault());
$indexes = $table->getIndexes();
@@ -60,16 +60,16 @@ $index = reset($indexes);
if ($config['system'] !== 'sqlite') {
Assert::same(2, count($indexes));
- Assert::true($index->primary);
- Assert::true($index->unique);
+ Assert::true($index->isPrimary());
+ Assert::true($index->isUnique());
Assert::same(1, count($index->getColumns()));
- Assert::same('product_id', $index->columns[0]->name);
+ Assert::same('product_id', $index->getColumns()[0]->getName());
$index = next($indexes);
}
-Assert::same('title', $index->name);
-Assert::false($index->primary);
-Assert::false($index->unique);
+Assert::same('title', $index->getName());
+Assert::false($index->isPrimary());
+Assert::false($index->isUnique());
Assert::same(1, count($index->getColumns()));
-Assert::same('title', $index->columns[0]->name);
+Assert::same('title', $index->getColumns()[0]->getName());