Fixing display of core error messages

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4877 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2007-04-18 16:39:11 +00:00
parent 4b7e496446
commit bb8c52dac0
14 changed files with 73 additions and 62 deletions

View file

@ -473,7 +473,7 @@ class DboMysql extends DboSource {
*/
function generateSchema($schema, $table = null) {
if (!is_a($schema, 'CakeSchema')) {
trigger_error(__('Invalid schema object'), E_USER_WARNING);
trigger_error(__('Invalid schema object', true), E_USER_WARNING);
return null;
}
$out = '';

View file

@ -158,7 +158,7 @@ class DboSource extends DataSource {
return $new;
}
/**
* Convenience method for DboSource::listSources().
* Convenience method for DboSource::listSources(). Returns source names in lowercase.
*
* @return array
*/
@ -318,7 +318,7 @@ class DboSource extends DataSource {
* @see DboSource::fetchRow
*/
function fetchArray() {
trigger_error(__('Deprecated: Use DboSource::fetchRow() instead'), E_USER_WARNING);
trigger_error(__('Deprecated: Use DboSource::fetchRow() instead', true), E_USER_WARNING);
return $this->fetchRow();
}
/**
@ -326,7 +326,7 @@ class DboSource extends DataSource {
* @see DboSource::fetchRow
*/
function one($sql) {
trigger_error(__('Deprecated: Use DboSource::fetchRow($sql) instead'), E_USER_WARNING);
trigger_error(__('Deprecated: Use DboSource::fetchRow($sql) instead', true), E_USER_WARNING);
return $this->fetchRow($sql);
}
/**

View file

@ -828,14 +828,16 @@ class Model extends Overloadable {
*
* @return array Array of table metadata
*/
function loadInfo() {
$db =& ConnectionManager::getDataSource($this->useDbConfig);
$db->cacheSources = $this->cacheSources;
function loadInfo($clear = false) {
if (!is_object($this->_tableInfo) || $clear) {
$db =& ConnectionManager::getDataSource($this->useDbConfig);
$db->cacheSources = $this->cacheSources;
if (!is_object($this->_tableInfo) && $db->isInterfaceSupported('describe') && $this->useTable !== false) {
$this->_tableInfo = new Set($db->describe($this));
} elseif ($this->useTable === false) {
return new Set();
if ($db->isInterfaceSupported('describe') && $this->useTable !== false) {
$this->_tableInfo = new Set($db->describe($this, $clear));
} elseif ($this->useTable === false) {
$this->_tableInfo = new Set();
}
}
return $this->_tableInfo;
}
@ -1652,7 +1654,7 @@ class Model extends Overloadable {
*/
function validates($data = array()) {
if (!empty($data)) {
trigger_error(__('(Model::validates) Parameter usage is deprecated, set the $data property instead'), E_USER_WARNING);
trigger_error(__('(Model::validates) Parameter usage is deprecated, set the $data property instead', true), E_USER_WARNING);
}
$errors = $this->invalidFields($data);
if (is_array($errors)) {
@ -1674,7 +1676,7 @@ class Model extends Overloadable {
if (empty($data)) {
$data = $this->data;
} else {
trigger_error(__('(Model::invalidFields) Parameter usage is deprecated, set the $data property instead'), E_USER_WARNING);
trigger_error(__('(Model::invalidFields) Parameter usage is deprecated, set the $data property instead', true), E_USER_WARNING);
}
if (!isset($this->validate) || empty($this->validate)) {