Index: trunk/core/units/config_search/config_search_event_handler.php
===================================================================
diff -u -r1821 -r2711
--- trunk/core/units/config_search/config_search_event_handler.php (.../config_search_event_handler.php) (revision 1821)
+++ trunk/core/units/config_search/config_search_event_handler.php (.../config_search_event_handler.php) (revision 2711)
@@ -81,7 +81,7 @@
$is_new = $event->MasterEvent->getEventParam('IsNew');
-
+ // TODO: direct access to private attributes of object is prohibited
$cf_search = array();
$cf_search['DisplayOrder'] = $cf_object->FieldValues['DisplayOrder'];
$cf_search['ElementType'] = $cf_object->FieldValues['ElementType'];
Index: trunk/core/kernel/db/dblist.php
===================================================================
diff -u -r2640 -r2711
--- trunk/core/kernel/db/dblist.php (.../dblist.php) (revision 2640)
+++ trunk/core/kernel/db/dblist.php (.../dblist.php) (revision 2711)
@@ -297,9 +297,7 @@
{
if (!$force && $this->Queried) return true;
$q = $this->GetSelectSQL();
- if ($this->DisplayQueries) {
- echo get_class($this)." Query SQL: $q LIMIT ".$this->PerPage." OFFSET ".$this->Offset." Page: ".$this->Page."
";
- }
+
//$rs = $this->Conn->SelectLimit($q, $this->PerPage, $this->Offset);
//in case we have not counted records try to select one more item to find out if we have something more than perpage
Index: trunk/core/kernel/db/dbitem.php
===================================================================
diff -u -r2460 -r2711
--- trunk/core/kernel/db/dbitem.php (.../dbitem.php) (revision 2460)
+++ trunk/core/kernel/db/dbitem.php (.../dbitem.php) (revision 2711)
@@ -248,19 +248,24 @@
$this->ID = $id;
$q = $this->GetSelectSQL().' WHERE '.(isset($keys_sql) ? $keys_sql : $this->GetKeyClause('load'));
- if ($this->DisplayQueries) {
- echo get_class($this)." Load SQL: $q
";
- }
- $this->FieldValues = array_merge_recursive2( $this->FieldValues, $this->Conn->GetRow($q) );
- if ($this->FieldValues === false) {
- //Error handling could be here
+ $field_values = $this->Conn->GetRow($q);
+ if($field_values)
+ {
+ $this->FieldValues = array_merge_recursive2($this->FieldValues, $field_values);
+ }
+ else
+ {
+ $this->Loaded = false;
return false;
}
- if (isset($keys_sql)) {
- $this->setID($this->FieldValues[$this->IDField]);
+
+ if( isset($keys_sql) )
+ {
+ $this->setID( $this->FieldValues[$this->IDField] );
}
- else {
+ else
+ {
$this->setID($id);
}
@@ -354,15 +359,7 @@
$sql.= sprintf(' WHERE %s', $this->GetKeyClause('update')); //Adding WHERE clause with Primary Key
- if ($this->DisplayQueries) echo "Sql: $sql
";
-
- if ($this->Conn->ChangeQuery($sql) === false) { //Executing query and checking results
- if ($this->DisplayQueries)
- {
- echo "Error executing statement: ".$adodbConnection->ErrorMsg()."
";
- }
- return false;
- }
+ if( $this->Conn->ChangeQuery($sql) === false ) return false;
$affected = $this->Conn->getAffectedRows();
if (!$system_update && $affected == 1){
@@ -647,15 +644,7 @@
$sql = sprintf('INSERT INTO %s (%s) VALUES (%s)', $this->TableName, $fields_sql, $values_sql); //Formatting query
//Executing the query and checking the result
-
- if ($this->Conn->ChangeQuery($sql) === false)
- {
- if($this->DisplayQueries)
- {
- echo "Error executing statement: ".$this->Conn->getErrorMsg().'
';
- }
- return false;
- }
+ if($this->Conn->ChangeQuery($sql) === false) return false;
$insert_id = $this->Conn->getInsertID();
if($insert_id == 0) $insert_id = $this->FieldValues[$this->IDField];
@@ -675,19 +664,14 @@
* @access public
* @return bool
*/
- function Delete($id=null)
+ function Delete($id = null)
{
- if( isset($id) ) {
- $this->setID($id);
- }
+ if( isset($id) ) $this->setID($id);
if( !$this->raiseEvent('OnBeforeItemDelete') ) return false;
$q = 'DELETE FROM '.$this->TableName.' WHERE '.$this->GetKeyClause('Delete');
- if ($this->DisplayQueries)
- {
- echo get_class($this).' Delete SQL: '.$q.'
';
- }
+
$ret = $this->Conn->ChangeQuery($q);
$this->setModifiedFlag();
Index: trunk/kernel/units/config_search/config_search_event_handler.php
===================================================================
diff -u -r1821 -r2711
--- trunk/kernel/units/config_search/config_search_event_handler.php (.../config_search_event_handler.php) (revision 1821)
+++ trunk/kernel/units/config_search/config_search_event_handler.php (.../config_search_event_handler.php) (revision 2711)
@@ -81,7 +81,7 @@
$is_new = $event->MasterEvent->getEventParam('IsNew');
-
+ // TODO: direct access to private attributes of object is prohibited
$cf_search = array();
$cf_search['DisplayOrder'] = $cf_object->FieldValues['DisplayOrder'];
$cf_search['ElementType'] = $cf_object->FieldValues['ElementType'];
Index: trunk/core/kernel/kbase.php
===================================================================
diff -u -r2387 -r2711
--- trunk/core/kernel/kbase.php (.../kbase.php) (revision 2387)
+++ trunk/core/kernel/kbase.php (.../kbase.php) (revision 2711)
@@ -144,14 +144,6 @@
var $SelectClause;
/**
- * Display queries executed by the class
- *
- * @var bool
- * @access public
- */
- var $DisplayQueries = false;
-
- /**
* Fields allowed to be set (from table + virtual)
*
* @var Array