public function UpdateUserType(Gyuser_Model_User $obj) { $update = false; switch ($obj->getClient_type()) { case 1: case 2: if ($this->checkPotencialClient($obj->getId())) { $update = true; } break; case 3: if ($this->checkActiveClient($obj->getId())) { $update = true; } break; case 4: if ($this->checkCobranzasOp($obj->getId())) { $update = true; } break; case 5: if ($this->checkPasiveClient($obj->getId())) { $update = true; } break; } if ($update) { $table = $this->getDbTable(); $set = array('client_type' => $obj->getClient_type(), 'type_change' => date('Y-m-d')); $where = array('id = ?' => $obj->getId()); $result = $table->update($set, $where); } else { $result = false; } return $result; }