Fixes in fields and mysqlclass
This commit is contained in:
parent
ecbaec5bbb
commit
c3ccbb16e0
4 changed files with 29 additions and 6 deletions
|
|
@ -15,8 +15,8 @@ class BooleanField extends PhangoField {
|
|||
public $label="";
|
||||
public $required=0;
|
||||
public $form="";
|
||||
public $quot_open='\'';
|
||||
public $quot_close='\'';
|
||||
public $quot_open='';
|
||||
public $quot_close='';
|
||||
public $std_error='';
|
||||
public $default_value=0;
|
||||
public $text_yes='';
|
||||
|
|
@ -37,7 +37,7 @@ class BooleanField extends PhangoField {
|
|||
|
||||
//$this->value=form_text($value);
|
||||
settype($value, "integer");
|
||||
|
||||
|
||||
if($value!=0 && $value!=1)
|
||||
{
|
||||
|
||||
|
|
@ -95,4 +95,4 @@ class BooleanField extends PhangoField {
|
|||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -61,6 +61,10 @@ class SerializeField extends PhangoField {
|
|||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$value=[];
|
||||
}
|
||||
|
||||
return $value;
|
||||
|
||||
|
|
|
|||
|
|
@ -43,10 +43,10 @@ class SQLClass {
|
|||
return $query;
|
||||
}
|
||||
|
||||
static public function webtsys_affected_rows( $idconnection , $server_data='default')
|
||||
static public function webtsys_affected_rows( $server_data='default' )
|
||||
{
|
||||
|
||||
$num_rows = mysqli_affected_rows(Webmodel::$connection[$server_data], $idconnection );
|
||||
$num_rows = mysqli_affected_rows(Webmodel::$connection[$server_data]);
|
||||
|
||||
return $num_rows;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -703,6 +703,13 @@ class Webmodel {
|
|||
|
||||
$args=$conditions[1];
|
||||
|
||||
if(gettype($args)!=='array')
|
||||
{
|
||||
|
||||
throw new \Exception('Error: you need an array how second parameter');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1486,6 +1493,18 @@ class Webmodel {
|
|||
|
||||
return $this->$func($query);
|
||||
}
|
||||
|
||||
/**
|
||||
* A helper method used for get number of affected rows of a last sql operation
|
||||
*
|
||||
*/
|
||||
|
||||
public function affected_rows()
|
||||
{
|
||||
|
||||
return SQLClass::webtsys_affected_rows($this->db_selected);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* A helper function for obtain an array from a result of $this->select
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue