Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change DataSource::listSources to Datasource::cachedListSources #309

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Cake/Model/Datasource/DataSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function __construct($config = array()) {
* @param mixed $data
* @return array Array of sources available in this datasource.
*/
public function listSources($data = null) {
public function cachedListSources($data = null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an API breaking change, it cannot be merged in.

if ($this->cacheSources === false) {
return null;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Model/Datasource/Database/Mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public function enabled() {
* @return array Array of tablenames in the database
*/
public function listSources($data = null) {
$cache = parent::listSources();
$cache = $this->cachedListSources();
if ($cache != null) {
return $cache;
}
Expand All @@ -201,7 +201,7 @@ public function listSources($data = null) {
}

$result->closeCursor();
parent::listSources($tables);
$this->cachedListSources($tables);
return $tables;
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Model/Datasource/Database/Postgres.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public function enabled() {
* @return array Array of tablenames in the database
*/
public function listSources($data = null) {
$cache = parent::listSources();
$cache = $this->cachedListSources();

if ($cache != null) {
return $cache;
Expand All @@ -176,7 +176,7 @@ public function listSources($data = null) {
}

$result->closeCursor();
parent::listSources($tables);
$this->cachedListSources($tables);
return $tables;
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Model/Datasource/Database/Sqlite.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public function enabled() {
* @return array Array of tablenames in the database
*/
public function listSources($data = null) {
$cache = parent::listSources();
$cache = $this->cachedListSources();
if ($cache != null) {
return $cache;
}
Expand All @@ -148,7 +148,7 @@ public function listSources($data = null) {
foreach ($result as $table) {
$tables[] = $table[0]['name'];
}
parent::listSources($tables);
$this->cachedListSources($tables);
return $tables;
}
return array();
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Model/Datasource/Database/Sqlserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public function enabled() {
* @return array Array of tablenames in the database
*/
public function listSources($data = null) {
$cache = parent::listSources();
$cache = $this->cachedListSources();
if ($cache !== null) {
return $cache;
}
Expand All @@ -187,7 +187,7 @@ public function listSources($data = null) {
}

$result->closeCursor();
parent::listSources($tables);
$this->cachedListSources($tables);
return $tables;
}
}
Expand Down