Skip to content

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

Closed
wants to merge 2 commits into from
View
2 lib/Cake/Model/Datasource/DataSource.php
@@ -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) {
@markstory
CakePHP member
markstory added a note Nov 8, 2011

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
if ($this->cacheSources === false) {
return null;
}
View
4 lib/Cake/Model/Datasource/Database/Mysql.php
@@ -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;
}
@@ -201,7 +201,7 @@ public function listSources($data = null) {
}
$result->closeCursor();
- parent::listSources($tables);
+ $this->cachedListSources($tables);
return $tables;
}
}
View
4 lib/Cake/Model/Datasource/Database/Postgres.php
@@ -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;
@@ -176,7 +176,7 @@ public function listSources($data = null) {
}
$result->closeCursor();
- parent::listSources($tables);
+ $this->cachedListSources($tables);
return $tables;
}
}
View
4 lib/Cake/Model/Datasource/Database/Sqlite.php
@@ -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;
}
@@ -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();
View
4 lib/Cake/Model/Datasource/Database/Sqlserver.php
@@ -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;
}
@@ -187,7 +187,7 @@ public function listSources($data = null) {
}
$result->closeCursor();
- parent::listSources($tables);
+ $this->cachedListSources($tables);
return $tables;
}
}
Something went wrong with that request. Please try again.