Changing our coding standards slightly:
[isso.git] / Api.php
diff --git a/Api.php b/Api.php
index 20f8488539ec99e825dd9dca7cc0a87e7e31d032..27d6ad728c401f22ef2ed25ee8b256a3ab6914eb 100644 (file)
--- a/Api.php
+++ b/Api.php
@@ -196,7 +196,7 @@ abstract class BSApi
                
                $this->setfields["$field"] = $field;
                
-               if ($dovalidate AND method_exists($this, "validate_$field"))
+               if ($dovalidate && method_exists($this, "validate_$field"))
                {
                        $this->{"validate_$field"}($field);
                }
@@ -211,11 +211,11 @@ abstract class BSApi
        */
        public function setCondition($condition = null)
        {
-               if (is_array($condition) AND sizeof($condition) > 0)
+               if (is_array($condition) && sizeof($condition) > 0)
                {
                        $this->condition = '';
                        
-                       foreach ($condition AS $field)
+                       foreach ($condition as $field)
                        {
                                if (!$this->values["$field"])
                                {
@@ -232,7 +232,7 @@ abstract class BSApi
                }
                else 
                {
-                       foreach ($this->fields AS $name => $options)
+                       foreach ($this->fields as $name => $options)
                        {
                                if ($options[F_REQ] == REQ_AUTO)
                                {
@@ -301,7 +301,7 @@ abstract class BSApi
                $this->_runActionMethod('pre_insert', $doPre);
                
                $fields = $values = array();
-               foreach ($this->setfields AS $field)
+               foreach ($this->setfields as $field)
                {
                        $fields[] = $field;
                        $values[] = $this->_prepareFieldForSql($field);
@@ -311,7 +311,7 @@ abstract class BSApi
                
                if (BSApp::$db instanceof BSDbPostgreSql)
                {
-                       foreach ($this->fields AS $field => $info)
+                       foreach ($this->fields as $field => $info)
                        {
                                if ($info[F_REQ] == REQ_AUTO)
                                {
@@ -348,7 +348,7 @@ abstract class BSApi
                
                $this->_runActionMethod('pre_update', $doPre);
                
-               foreach ($this->setfields AS $field)
+               foreach ($this->setfields as $field)
                {
                        $updates[] = "$field = " . $this->_prepareFieldForSql($field);
                }
@@ -388,7 +388,7 @@ abstract class BSApi
        */
        private function _verifyRequired()
        {
-               foreach ($this->fields AS $name => $options)
+               foreach ($this->fields as $name => $options)
                {
                        if ($options[F_REQ] == REQ_YES)
                        {
@@ -413,7 +413,7 @@ abstract class BSApi
        */
        private function _runActionMethod($method, $doRun)
        {
-               if (!$doRun OR !method_exists($this, $method))
+               if (!$doRun || !method_exists($this, $method))
                {
                        return;
                }
@@ -434,7 +434,7 @@ abstract class BSApi
        {
                $type = $this->fields["$name"][F_TYPE];
                
-               if ($type == TYPE_NONE OR $type == TYPE_STR OR $type == TYPE_STRUN)
+               if ($type == TYPE_NONE || $type == TYPE_STR || $type == TYPE_STRUN)
                {
                        return "'" . BSApp::$db->escapeString($this->values["$name"]) . "'";
                }